Skip to content

Example Workflows - Workflows with foundation models

Below you can find example workflows you can use as inspiration to build your apps.

Workflow with Segment Anything 2 model

Meta AI introduced very capable segmentation model called SAM 2 which has capabilities of producing segmentation masks for instances of objects.

EXAMPLE REQUIRES DEDICATED DEPLOYMENT and will not run in preview!

Workflow definition
{
    "version": "1.0",
    "inputs": [
        {
            "type": "WorkflowImage",
            "name": "image"
        },
        {
            "type": "WorkflowParameter",
            "name": "mask_threshold",
            "default_value": 0.0
        },
        {
            "type": "WorkflowParameter",
            "name": "version",
            "default_value": "hiera_tiny"
        }
    ],
    "steps": [
        {
            "type": "roboflow_core/segment_anything@v1",
            "name": "segment_anything",
            "images": "$inputs.image",
            "threshold": "$inputs.mask_threshold",
            "version": "$inputs.version"
        }
    ],
    "outputs": [
        {
            "type": "JsonField",
            "name": "predictions",
            "selector": "$steps.segment_anything.predictions"
        }
    ]
}