SAM2 class implements a wrapper for the Segment Anything 2.1 (SAM2) model, which segments objects in RGB images
and videos based on input prompts.
boolean
default:"False"
If True, inference call is run on the local VM, else offloaded onto GRID-Cortex. Defaults to False.
np.ndarray
required
The input RGB image of shape .
np.ndarray
required
Points in the form of coordinates of shape to segment.
np.ndarray
required
The labels of the points to segment.
boolean
default:"False"
If True, returns a list of masks of shape . Defaults to False. The mutlimask feature is only available for local inference.
np.ndarray
The predicted output.
- License
- Source
This code is licensed under the Apache 2.0, and BSD-3 License.