Image segmentation

Guide on drawing semantic and panoptic segmentation masks on images.

To work with image segmentation, use the Polygon tool. To make sure the polygon tool is available in the annotation workspace, when creating the task, make sure Object Detection is checked as the type of task, and Polygon is checked as the annotation tools you want to use.

Creating masks

To start creating a segmentation mask, select the Polygon tool, and click anywhere on the image to add a point to the mask. When the mask is complete, either click on an existing point in the mask, or press the N key on the keyboard.

Instead of clicking to place each point, you can also press and hold the Shift key, and simply move your mouse. This will place points at regular intervals all along the path followed by the mouse.

Once created, you can copy the mask and paste it anywhere on the image. This can be helpful when you have multiple objects in the image that have very similar boundaries. To do this, first copy the object by pressing the copy button in object card in the right sidebar. This will create a movable mask outline. When ready, click anywhere in the image to place the copied mask.

Updating a mask

Once a mask has been created, you can update it in multiple different ways.

  1. To move a an existing point. simply drag the point using your mouse.

  2. To delete a point, right click on the point and click on delete in the context menu. When a point is deleted, it's neighbouring points are joined to create a new path.

  3. To update part of the mask

    1. Press and hold the Shift key.

    2. Click on the starting point of the path you want to update.

    3. Add the new points.

    4. Click on any existing point of the original mask to close the new path and update the mask.

Working with Layers

When there are a lot of objects in an image, they can often overlap with each other. Drawing boundaries of neighbouring objects can be tedious in such a case. Using layers makes it easier to manage overlapping objects.

An object in a higher layer (e.g. Layer 1 is higher than Layer 0) will be placed over an object in a lower layer. When an object is placed over another, it effectively masks it - hiding any overlapping parts of the object in the lower layer. By default all objects are drawn in Layer 0. In order to move them to a higher or lower layer, use the two buttons below the Label selection dropdown in the object card.

At any point, if you want to preview the segmentation mask, open the Segmentation sub-menu in the left sidebar, and check "Show segmentation mask".

If objects in your image overlap with each other, avoid placing objects in the same layer. Otherwise, exported masks can contain arbitrary order of the objects, placing some above others.

Exporting masks

Once the masks have been created, you can export them in many different formats.

To export the annotations as PNG masks, choose Segmentation mask from the export annotations dialog box on the task page. The downloaded files will contain both semantic segmentation as well instance segmentation masks in separate directories. Do note that processing the masks can take some time. You will receive a notification when the export is ready.

If you wish to export the annotations in polygon format - choose one of the following formats.

  1. COCO

  2. Datumaro

  3. Pascal VOC

  4. YOLO

Last updated