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
|
{
"type": "object",
"title": "Input",
"required": [
"image",
"prompt"
],
"properties": {
"image": {
"type": "string",
"title": "Image",
"format": "uri",
"x-order": 0,
"description": "Image to segment"
},
"prompt": {
"type": "string",
"title": "Prompt",
"x-order": 1,
"description": "Concept to find \u2014 a short noun phrase, e.g. 'logo', 'person', 'red car'. Every matching instance is returned."
},
"threshold": {
"type": "number",
"title": "Threshold",
"default": 0.5,
"maximum": 1,
"minimum": 0,
"x-order": 2,
"description": "Min confidence score to keep a detection"
},
"return_masks": {
"type": "boolean",
"title": "Return Masks",
"default": true,
"x-order": 4,
"description": "Include the base64 PNG segment in each detection"
},
"mask_threshold": {
"type": "number",
"title": "Mask Threshold",
"default": 0.5,
"maximum": 1,
"minimum": 0,
"x-order": 3,
"description": "Probability cutoff for binarising each mask"
}
}
}
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"
}
}
}