docstr: Calculates the image embeddings for the provided image, allowing
  masks to be predicted with the 'predict' method. Expects the input
  image to be already transformed to the format expected by the model.
  
  Arguments:
    transformed_image (paddle.Tensor): The input image, with shape
      1x3xHxW, which has been transformed with ResizeLongestSide.
    original_image_size (tuple(int, int)): The size of the image
      before transformation, in (H, W) format.
docstr_tok: ["Calculates","the","image","embeddings","for","the","provided","image",",","allowing","masks","to","be","predicted","with","the","'predict","'","method",".","Expects","the","input","image","to","be","already","transformed","to","the","format","expected","by","the","model",".","Arguments",":","transformed_image","(","paddle.Tensor",")",":","The","input","image",",","with","shape","1x3xHxW",",","which","has","been","transformed","with","ResizeLongestSide",".","original_image_size","(","tuple","(","int",",","int",")",")",":","The","size","of","the","image","before","transformation",",","in","(","H",",","W",")","format","."]
code: def set_paddle_image(
      self,
      transformed_image: paddle.Tensor,
      original_image_size: Tuple[int, ...],
  ) -> None:
      """
      Calculates the image embeddings for the provided image, allowing
      masks to be predicted with the 'predict' method. Expects the input
      image to be already transformed to the format expected by the model.
  
      Arguments:
        transformed_image (paddle.Tensor): The input image, with shape
          1x3xHxW, which has been transformed with ResizeLongestSide.
        original_image_size (tuple(int, int)): The size of the image
          before transformation, in (H, W) format.
      """
      assert (
          len(transformed_image.shape) == 4
          and transformed_image.shape[1] == 3
          and max(*transformed_image.shape[2:])
          == self.model.image_encoder.img_size
      ), f"set_paddle_image input must be BCHW with long side {self.model.image_encoder.img_size}."
      self.reset_image()
  
      self.original_size = original_image_size
      self.input_size = tuple(transformed_image.shape[-2:])
      input_image = self.model.preprocess(transformed_image)
      self.features = self.model.image_encoder(input_image)
      self.is_image_set = True
  
file_path: PaddleSeg/contrib/SegmentAnything/segment_anything/predictor.py
imports: import numpy
  from typing import Optional, Tuple
  import paddle
  from .modeling import Sam
  from .utils.transforms import ResizeLongestSide
label_desc: Use image node_id 3 for calling the SamPredictor obj's underlying member method code with example usage: obj.set_paddle_image(transformed_image, original_image_size) without return types