varad-13/sam-3

Public
5.7K runs

Run varad-13/sam-3 with an API

Use one of our client libraries to get started quickly. Clicking on a library will take you to the Playground tab where you can tweak different inputs, see the results, and copy the corresponding code to use in your own project.

Input schema

The fields you can use to run this model with an API. If you don't give a value for a field its default value will be used.

Field Type Default value Description
image
string
Image to segment
prompt
string
Concept to find — a short noun phrase, e.g. 'logo', 'person', 'red car'. Every matching instance is returned.
threshold
number
0.5

Max: 1

Min confidence score to keep a detection
mask_threshold
number
0.5

Max: 1

Probability cutoff for binarising each mask
return_masks
boolean
True
Include the base64 PNG segment in each detection

Output schema

The shape of the response you’ll get when you run this model with an API.

Schema
{
  "type": "object",
  "title": "Output",
  "required": [
    "count",
    "detections"
  ],
  "properties": {
    "count": {
      "type": "integer",
      "title": "Count"
    },
    "detections": {
      "type": "array",
      "items": {
        "type": "object",
        "title": "Detection",
        "required": [
          "score",
          "box",
          "rotated_box",
          "area",
          "mask"
        ],
        "properties": {
          "box": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "title": "Box"
          },
          "area": {
            "type": "integer",
            "title": "Area"
          },
          "mask": {
            "type": "string",
            "title": "Mask"
          },
          "score": {
            "type": "number",
            "title": "Score"
          },
          "rotated_box": {
            "type": "object",
            "title": "RotatedBox",
            "required": [
              "center",
              "size",
              "angle",
              "points"
            ],
            "properties": {
              "size": {
                "type": "array",
                "items": {
                  "type": "number"
                },
                "title": "Size"
              },
              "angle": {
                "type": "number",
                "title": "Angle"
              },
              "center": {
                "type": "array",
                "items": {
                  "type": "number"
                },
                "title": "Center"
              },
              "points": {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "number"
                  }
                },
                "title": "Points"
              }
            }
          }
        }
      },
      "title": "Detections"
    }
  }
}