Annotation

Polygon & Segmentation Annotator

Click around an object to place vertices, close the polygon with a double click or Enter, and drag any vertex afterwards. Polygons export as COCO segmentation arrays or YOLO segmentation lines, which is what Ultralytics yolo segment, Detectron2 and MMDetection read.

Loading the tool…

How it works

01

Place vertices

Click to add a point; double-click or Enter closes the shape. Hold Shift for straight axis-aligned edges. Backspace removes the last point.

02

Edit

Drag a vertex to move it, Alt-click an edge to insert a vertex, Alt-click a vertex to delete it. Number keys set the class.

03

Export

COCO writes segmentation, bbox and area per instance; YOLO-seg writes class followed by normalised x y pairs, one instance per line.

Formats, limits and the numbers that matter

Bounding boxes are derived

Both exports include the polygon's bounding box, so a segmentation dataset can also train a detector without relabelling.

Holes

COCO's polygon format has no holes; draw the outer shape only. For hole-shaped masks use RLE from a mask tool, which is on the roadmap.

Precision

Coordinates are exported at original image resolution with two decimals, which is finer than any mask rasteriser uses.

Common questions

How many vertices should a polygon have?

Enough to follow the edge within a couple of pixels at the size the model will see. 12-40 is typical; a circle needs 16 to look round at 640 px.

Can I convert polygons to boxes only?

Yes; export COCO and open it in the Label Format Converter, which writes YOLO detection labels from the bbox field.

Is there automatic segmentation?

Not yet. Everything here is manual and runs locally; a browser SAM-style helper is planned.