Outline objects (Segment Anything)
segment_objectsTrace precise object outlines from rough boxes or points with Segment Anything, then save them as polygon annotations for image labeling; supports medical images via MedSAM.
Instructions
Trace precise outlines with Segment Anything and add them as polygon annotations.
Give each object a rough box (or a point on it) in image pixels; the model finds the object's exact edges, so the box only has to contain the object. Prefer this to drawing polygons yourself. model: "sam" for photos and general images; "medsam" for medical images (CT, MRI, X-ray, ultrasound, endoscopy, pathology), which takes boxes only. Up to 20 objects per call. With save=false the outlines are returned without being saved. Each result has the model's quality score (0-1).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"image_id": "<image_id>",
"objects": "<objects>"
},
"name": "segment_objects"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| save | No | Save the outlines as polygon annotations; false only returns them. | |
| model | No | 'sam' for everyday images; 'medsam' for medical images (CT, MRI, X-ray, ultrasound, endoscopy, pathology), which needs a box for every object. | sam |
| objects | Yes | Objects to outline, each with a label and a rough box (x, y, width, height), a point on it, or both, in image pixels. | |
| image_id | Yes | Id of an image in Image Label: the imageId (a UUID string) returned by list_images or an upload. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||