This guide explains how to convert polygon-based segmentation mask annotations into a CSV file that conforms to Visual Layer’s object annotation format.
label
: Represents the object class (e.g., “QSBD”).points
: Array of [x, y] coordinates defining the polygon boundary.shape_type
: Type of annotation (“polygon” for segmentation masks).imagePath
: Corresponding image filename.
filename
: The image file name.col_x
: The x‑coordinate (column) of the top‑left corner.row_y
: The y‑coordinate (row) of the top‑left corner.width
: Bounding box width (pixels).height
: Bounding box height (pixels).label
: The object label (e.g., “QSBD”).
filename | col_x | row_y | width | height | label |
---|---|---|---|---|---|
example.png | 64 | 10 | 4 | 5 | QSBD |
example.png | 64 | 26 | 14 | 17 | QSBD |
example.png | 65 | 68 | 13 | 24 | QSBD |
filename
: Name of the image file.col_x
& row_y
: Top‑left pixel coordinates of the bounding box.width
& height
: Width and height of the bounding box in pixels.label
: Object label from the segmentation mask.
annotations
folderpython convert_segmentation.py
segmentation_annotations.csv
will be generated