Table of Contents
Updated by Alex Cota
You can use the image segmentation tool to create mask annotations. The segmentation tool is often used to label images for applications that require high accuracy.
Import image data
To learn how to import your images directly, see Direct upload. To learn how to import your images URLs via JSON, see Import via JSON. To learn how to attach metadata to your imported images, see Asset metadata via JSON.
To learn how to import programmatically, see Bulk add data rows.
Set up Image segmentation
Follow these steps to set up your ontology with Image segmentation.
- Create a project.
- Select "Editor" as your label editor.
- Click "Add object".
- Select "Segmentation" as your labeling tool and name the Object.
- [OPTIONAL] Configure nested classifications.
- Click "Confirm".
- Click "Complete setup".
To see a sample script for setting up your project’s ontology programmatically, see Project setup script.
Use the Pen tool to outline items in the image. Hold the cursor down to draw freehand or let the cursor go to draw straight lines between points. Select the (-) icon to draw around an area to erase. The Pen tool is only available when creating Segmentation annotations.
Draw over existing objects
"Draw over existing objects" is on by default. When this tool is enabled, drawing a new Segmentation annotation over an existing annotation will overwrite previously classified pixels. When this tool is disabled, a new Segmentation annotation drawn over an existing annotation will be "drawn behind" the existing annotation.
This tool is designed to significantly speed up labeling time since it is not required to intricately outline around the border of other objects. This tool is only available when creating Segmentation annotations.
For Segmentation annotations with complex boundaries, using the Superpixel tool first may be more efficient than using the Pen tool alone. Superpixel works by calculating segment clusters of similarly colored pixels in the image.
In the top toolbar is a slider, which allows you to adjust the size of segment clusters from XS to XL. After you select a segment cluster size, choose an Object from the left Tools panel and use your cursor to select and classify each segment to be included in that Segmentation annotation. You can then adjust the boundaries using the Pen and Eraser tools.
From the Editor, you can create instances of your Object classes in your ontology. For example, if there are 5 fish in an image and you would like to assign the "Fish" class to all five, you can create multiple instances of the "Fish" class.
To create multiple instances of the same object:
- Select a class from the Tools menu and draw the object.
- Select the class again.
- Draw the next instance of the object.
Convert mask to polygon coordinates
If you need to convert your vector masks to polygon coordinates, you can use this script here. You will need to pip install labelbox first. See our Getting started page in our Python docs for installation instructions.