Segmentation
Segment Anything 2
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.
class SAM2()
If True, inference call is run on the local VM, else offloaded onto GRID-Cortex. Defaults to False.
def run()
The input RGB image of shape .
Points in the form of coordinates of shape to segment.
The labels of the points to segment.
If True, returns a list of masks of shape . Defaults to False. The mutlimask feature is only available for local inference.
The predicted output.
This code is licensed under the Apache 2.0, and BSD-3 License.
Was this page helpful?