docstr: Uses SAM to calculate the image embedding for an image, and then
  allow repeated, efficient mask prediction given prompts.
  
  Arguments:
    sam_model (Sam): The model to use for mask prediction.
docstr_tok: ["Uses","SAM","to","calculate","the","image","embedding","for","an","image",",","and","then","allow","repeated",",","efficient","mask","prediction","given","prompts",".","Arguments",":","sam_model","(","Sam",")",":","The","model","to","use","for","mask","prediction","."]
code: def __init__(
      self,
      sam_model: Sam,
  ) -> None:
      """
      Uses SAM to calculate the image embedding for an image, and then
      allow repeated, efficient mask prediction given prompts.
  
      Arguments:
        sam_model (Sam): The model to use for mask prediction.
      """
      super().__init__()
      self.model = sam_model
      self.transform = ResizeLongestSide(
          sam_model.image_encoder.img_size
      )
      self.reset_image()
  
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 1 to create a new SamPredictor object  with example: obj = SamPredictor(sam_model)