class_docstr: Wrapper for running `Segment Anything <https://segment-anything.com>`_
  inference.
  
  Box prompt example::
  
      import fiftyone as fo
      import fiftyone.zoo as foz
  
      dataset = foz.load_zoo_dataset(
          "quickstart", max_samples=25, shuffle=True, seed=51
      )
  
      model = foz.load_zoo_model("segment-anything-vitb-torch")
  
      # Prompt with boxes
      dataset.apply_model(
          model,
          label_field="segmentations",
          prompt_field="ground_truth",
      )
  
      session = fo.launch_app(dataset)
  
  Keypoint prompt example::
  
      import fiftyone as fo
      import fiftyone.zoo as foz
  
      dataset = foz.load_zoo_dataset(
          "coco-2017",
          split="validation",
          label_types="detections",
          classes=["person"],
          max_samples=25,
          only_matching=True,
      )
  
      # Generate some keypoints
      model = foz.load_zoo_model("keypoint-rcnn-resnet50-fpn-coco-torch")
      dataset.default_skeleton = model.skeleton
      dataset.apply_model(model, label_field="gt")
  
      model = foz.load_zoo_model("segment-anything-vitb-torch")
  
      # Prompt with keypoints
      dataset.apply_model(
          model,
          label_field="segmentations",
          prompt_field="gt_keypoints",
      )
  
      session = fo.launch_app(dataset)
  
  Automatic segmentation example::
  
      import fiftyone as fo
      import fiftyone.zoo as foz
  
      dataset = foz.load_zoo_dataset(
          "quickstart", max_samples=5, shuffle=True, seed=51
      )
  
      model = foz.load_zoo_model("segment-anything-vitb-torch")
  
      # Automatic segmentation
      dataset.apply_model(model, label_field="auto")
  
      session = fo.launch_app(dataset)
  
  Args:
      config: a :class:`SegmentAnythingModelConfig`
class_docstr_tok: ["Wrapper","for","running","`","Segment","Anything","<","https",":","\/\/segment-anything.com",">","`","_","inference",".","Box","prompt","example",":",":","import","fiftyone","as","fo","import","fiftyone.zoo","as","foz","dataset","=","foz.load_zoo_dataset","(","``","quickstart","''",",","max_samples=25",",","shuffle=True",",","seed=51",")","model","=","foz.load_zoo_model","(","``","segment-anything-vitb-torch","''",")","#","Prompt","with","boxes","dataset.apply_model","(","model",",","label_field=","''","segmentations","''",",","prompt_field=","''","ground_truth","''",",",")","session","=","fo.launch_app","(","dataset",")","Keypoint","prompt","example",":",":","import","fiftyone","as","fo","import","fiftyone.zoo","as","foz","dataset","=","foz.load_zoo_dataset","(","``","coco-2017","''",",","split=","''","validation","''",",","label_types=","''","detections","''",",","classes=","[","``","person","''","]",",","max_samples=25",",","only_matching=True",",",")","#","Generate","some","keypoints","model","=","foz.load_zoo_model","(","``","keypoint-rcnn-resnet50-fpn-coco-torch","''",")","dataset.default_skeleton","=","model.skeleton","dataset.apply_model","(","model",",","label_field=","''","gt","''",")","model","=","foz.load_zoo_model","(","``","segment-anything-vitb-torch","''",")","#","Prompt","with","keypoints","dataset.apply_model","(","model",",","label_field=","''","segmentations","''",",","prompt_field=","''","gt_keypoints","''",",",")","session","=","fo.launch_app","(","dataset",")","Automatic","segmentation","example",":",":","import","fiftyone","as","fo","import","fiftyone.zoo","as","foz","dataset","=","foz.load_zoo_dataset","(","``","quickstart","''",",","max_samples=5",",","shuffle=True",",","seed=51",")","model","=","foz.load_zoo_model","(","``","segment-anything-vitb-torch","''",")","#","Automatic","segmentation","dataset.apply_model","(","model",",","label_field=","''","auto","''",")","session","=","fo.launch_app","(","dataset",")","Args",":","config",":","a",":","class",":","`","SegmentAnythingModelConfig","`"]
code: def predict_all(self, imgs, samples=None):
      field_name = self._get_field()
      if field_name is not None and samples is not None:
          prompt_type, prompts, classes = self._parse_samples(
              samples, field_name
          )
      else:
          prompt_type, prompts, classes = None, None, None
  
      self._curr_prompt_type = prompt_type
      self._curr_prompts = prompts
      self._curr_classes = classes
  
      return self._predict_all(imgs)
  
imports: import numpy
  import eta.core.utils
  import fiftyone.core.labels
  import fiftyone.core.utils
  import fiftyone.utils.torch
  import fiftyone.zoo.models
  import torch
label_desc: Use image node_id 4 for calling the SegmentAnythingModel obj's underlying member method code with example usage: obj.predict_all(imgs, samples) and returns: self