Polygon annotation

Polygon annotation outlines an object with a closed chain of vertices that follows its boundary, giving a segmentation label that is lighter to store and edit than a pixel mask and far tighter than a bounding box. In Supervisely, touching polygons share one border and keep their holes.

Annotation

Polygon, box or mask

ShapeGood forWeak spot
Bounding boxDetection, fast labelingIncludes background around irregular objects
PolygonSegmentation of objects with clear edgesMany vertices on curved or fuzzy edges
Bitmap maskHair, foliage, ragged or thin structuresHeavier 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.

Frequently asked questions.

What is polygon annotation?

Outlining an object with a closed polygon of vertices that follow its edge, so the label fits irregular shapes much more closely than a bounding box. It is the usual input for instance and semantic segmentation.

Polygon or bounding box: which should I use?

Boxes are faster to draw and enough for object detection. Use polygons when the model has to learn the outline, for segmentation, or when objects are irregular or overlapping.