For the complete documentation index, see llms.txt. This page is also available as Markdown.

Segment Anything 2 Model

Convert bounding boxes to polygons, or run SAM2 on an entire image to generate a mask.

Run Segment Anything 2, a zero-shot instance segmentation model, on an image.

** Dedicated inference server required (GPU recomended) **

You can use pass in boxes/predictions from other models to Segment Anything 2 to use as prompts for the model. If you pass in box detections from another model, the class names of the boxes will be forwarded to the predicted masks. If using the model unprompted, the model will assign integers as class names / ids.

Type identifier

Use the following identifier in step "type" field: roboflow_core/segment_anything@v1 to add the block as a step in your workflow.

Properties

Name

Type

Description

Refs

name

str

Enter a unique identifier for this step..

version

str

Model to be used. One of hiera_large, hiera_small, hiera_tiny, hiera_b_plus.

threshold

float

Threshold for predicted masks scores.

multimask_output

bool

Flag to determine whether to use sam2 internal multimask or single mask mode. For ambiguous prompts setting to True is recomended..

The Refs column marks possibility to parametrise the property with dynamic values available in workflow runtime. See Bindings for more info.

Runtime compatibility

hard - runtime self_hosted_cpu; execution local : Requires a GPU; run_locally() loads a model that needs CUDA.

Input and Output Bindings

The available connections depend on its binding kinds. Check what binding kinds Segment Anything 2 Model in version v1 has.

Input and output bindings
Example JSON definition

Last updated

Was this helpful?