Skip to content

Annotate Polygons

Overview ​

Assigns visual attributes to a list of polygons — color, line thickness, opacity, and labels. Use this node to define how detections from an AI model or any other polygons should appear when rendered by the Draw Polygons node.

Use Annotate Polygons when:

  • You want to color-code different object classes (e.g., green for "pass", red for "fail").
  • You need to add text labels to detected objects for visual inspection.
  • You have multiple detection categories that each need distinct styling — add one Annotate Polygons node per category.

💡 Tip

This node only defines visual attributes; it does not draw polygons on the image. Connect its output to a Draw Polygons node to render the results.

Inputs ​

NameTypeDescription
polygon_listlist[polygon]The list of polygons to receive the visual attributes.
labelstringAn optional text label applied to every polygon in the list.

Outputs ​

NameTypeDescription
annotated_polygon_listlist[polygon]The polygons with the assigned color, thickness, and label properties.

Parameters ​

ParameterDefaultValid valuesUnitTunable
Polygon Color#00FF00hex string-✅
Label Color#FFFFFFhex string-✅
Label Font Size148 – 48px✅
Label Positiontop_lefttop_left, bottom_left-✅
Line Thickness21 – 5px✅
Opacity00 – 100%✅

Polygon Color ​

The hex color code for the polygon outlines. Click the color preview to open a dialog with HEX and RGB inputs, or select a color visually from the gradient palette.

Color picker
Hex color picker for setting polygon outline color and label color.

Label Color ​

The hex color code for the label text. Uses the same color picker as the Polygon Color field.

Label Font Size ​

The size of the text used for polygon labels, in pixels.

Label Position ​

Determines where the text label is anchored relative to the polygon:

  • top_left (default) — top-left corner of the polygon bounding box.
  • bottom_left — bottom-left corner of the polygon bounding box.

If a label would extend beyond the image boundary, the position switches automatically to keep it visible. The label background uses the polygon's color for easy visual association.

â„šī¸ Label Positioning

Labels are automatically repositioned to avoid overflow outside the image. If a label would extend beyond the top, bottom, or right edge of the image, it switches to the opposite vertical position or shifts horizontally to stay visible.

Line Thickness ​

The width of the polygon borders in pixels.

Opacity ​

The fill transparency of the polygons. 0% is fully transparent, 100% is fully opaque.

Example ​

Defect inspection with two categories ​

A model identifies products as either acceptable or defective. Use two Annotate Polygons nodes: one colors acceptable items green with a "Pass" label, the other colors defective items red with a "Defect" label.

Configuration (defect node):

  • Polygon Color: #FF0000
  • Label Font Size: 18

Result: Defective polygons appear with a red border and an 18 px "Defect" label. Acceptable polygons appear green with "Pass".

Two detected objects with red bounding boxes labeled Defect with confidence percentages
Two detections annotated with red polygon outlines and a 'Defect' label showing the confidence percentage. The label background matches the polygon color for quick visual association.

Reference:

  • Draw Polygons — renders the annotated polygons onto an image
  • Polygon Blur — applies Gaussian blur to polygon regions