Polygon, box or mask
| Shape | Good for | Weak spot |
|---|---|---|
| Bounding box | Detection, fast labeling | Includes background around irregular objects |
| Polygon | Segmentation of objects with clear edges | Many vertices on curved or fuzzy edges |
| Bitmap mask | Hair, foliage, ragged or thin structures | Heavier files, harder to edit by hand |
Drawing polygons that train well
- Place vertices where the boundary turns; add more on curves, fewer on straight edges.
- Cut holes for what shows through the object, such as the gap inside a ring or a window in a fence.
- Let neighbouring objects share their border instead of leaving slivers or overlapping.
- Decide whether an object split by an occluder is one object with two parts; write it into the annotation guidelines.
How formats store polygons
COCO keeps polygons as flat lists of pixel coordinates, or switches to run-length masks for crowds. YOLO segmentation stores one normalized polygon per line. Cityscapes polygons have no holes, so holes are lost on the way there. The COCO to YOLO page shows what changes in a conversion.
Common errors
- Too few vertices on round objects, which cuts off the edges a segmentation model is graded on.
- Self-intersecting outlines that tools fill differently.
- Gaps between adjacent parcels or buildings, which GIS software rejects.
Polygons in Supervisely
In the image labeling tool touching objects share one border and polygons keep their holes, and aerial or satellite outlines stay free of gaps and overlaps. When tracing by hand is slow, the Smart Tool returns a mask from a box for a few clicks of correction; click models such as RITM refine it with positive and negative points. Guides: the polygon annotation tool and scalable polygon annotation.