Skip to main content
The 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 (M,N,3)(M, N, 3).
np.ndarray
required
Points in the form of coordinates of shape (x,y)(x, y) to segment.
np.ndarray
required
The labels of the points to segment.
boolean
default:"False"
If True, returns a list of masks of shape (M,N)(M,N). Defaults to False. The mutlimask feature is only available for local inference.
np.ndarray
The predicted output.
This code is licensed under the Apache 2.0, and BSD-3 License.