From Apple Pencil to a COCO segmentation dataset
Learn how to draw an image mask on iPad and inspect a COCO segmentation dataset with two sample images.
Draw and export an image mask
Import an image, choose a label, and trace the object with Apple Pencil. Use assisted segmentation where needed. Select the annotated images and choose COCO in the export options.
Inspect the synthetic sample
The website sample contains two synthetic images, one polygon annotation per image, and one category called part.
Unzip the download and open annotations/instances_sample.json. Match an annotation’s image_id to the corresponding entry in images, then open its file_name from the images/ folder.
Read segmentation as alternating x and y pixel coordinates. Join each point in order and close the polygon to recreate the mask.
Match category_id to a category. The bbox stores the top-left x and y, width, and height in pixels. The area is measured in square pixels.
