An Object-type annotation that classifies pixels in an image.

A segmentation mask is an Object-type annotation that labels pixels in an image.

Import

When you import Segmentation mask annotations via the Model-assisted labeling workflow, your JSON file must contain the following information for each Segmentation mask.

Parameter

Asset type

Required

Description

uuid

Image

Yes

A user-generated UUID for each annotation. If you import an annotation to a Data Row and there is already an imported annotation with the same uuid on that Data Row, the latest import will override the previous one. The uuid must be 128 bits (32 characters). The following formats are supported:

  • A0EEBC99-9C0B-4EF8-BB6D-6BB9BD380A11

  • {a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11}

  • a0eebc999c0b4ef8bb6d6bb9bd380a11

  • a0ee-bc99-9c0b-4ef8-bb6d-6bb9-bd38-0a11

  • {a0eebc99-9c0b4ef8-bb6d6bb9-bd380a11}

schemaId

Image

Yes

The ID of the schema that contains all of the information needed for rendering your annotation.

dataRow.id

Image

Yes

The ID of the Data Row where you want to attach the imported annotations.

mask.instanceURI

Image

Yes

Cloud-hosted mask (can be hosted on any cloud provider). If you are importing multiple mask annotations on a single Data Row, each mask should reference the same instanceURI. See example below.

mask.colorRGB

Image

Yes

An array of RGB values from 0 to 255 that indicates which color represents each given mask. Only 3-channel RGB colors are supported.

{
    "uuid": "45b15f9d-7884-4bb7-ac01-3567e8ed6c36",
    "schemaId": "ck68grts29n7w0890wv344dif",
    "dataRow": {
        "id": "cjxav5aa07r1g0dsq70t9eveg"
    },
    "mask": {
        "instanceURI": "https://api.labelbox.com/masks/feature/ckmuuw2tq00053g68rbwjpoim?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjazUycnZ4MWtxYXpiMDc3MDBtcTI3eDRsIiwib3JnYW5pemF0aW9uSWQiOiJjazUycnZ4MG1wdzRnMDc2NndncXZqdGw5IiwiaWF0IjoxNjE3MDM4NDAwLCJleHAiOjE2MTk2MzA0MDB9.5YaORL6mWpPqgAb6IbWChm4MQo14obOU8LFWbfCEHR0",
        "colorRGB": [
            255,
            255,
            255
        ]
    }
}{
    "uuid": "3a95ddcd-3ad0-4dc5-a24e-c05004b4b4d5",
    "schemaId": "ck7wi85rnd1050757aac5ba4d",
    "dataRow": {
        "id": "cjxav5aa07r1g0dsq70t9eveg"
    },
    "mask": {
        "instanceURI": "https://api.labelbox.com/masks/feature/ckmuuw2tq00053g68rbwjpoim?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjazUycnZ4MWtxYXpiMDc3MDBtcTI3eDRsIiwib3JnYW5pemF0aW9uSWQiOiJjazUycnZ4MG1wdzRnMDc2NndncXZqdGw5IiwiaWF0IjoxNjE3MDM4NDAwLCJleHAiOjE2MTk2MzA0MDB9.5YaORL6mWpPqgAb6IbWChm4MQo14obOU8LFWbfCEHR0",
        "colorRGB": [
            255,
            0,
            0
        ]
    }
}{
    "uuid": "f8284cbc-ecf3-4363-9e10-138501daf5f7",
    "schemaId": "ck7wi85pr1xz6079026yc0hch",
    "dataRow": {
        "id": "cjxav5aa07r1g0dsq70t9eveg"
    },
    "mask": {
        "instanceURI": "https://api.labelbox.com/masks/feature/ckmuuw2tq00053g68rbwjpoim?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjazUycnZ4MWtxYXpiMDc3MDBtcTI3eDRsIiwib3JnYW5pemF0aW9uSWQiOiJjazUycnZ4MG1wdzRnMDc2NndncXZqdGw5IiwiaWF0IjoxNjE3MDM4NDAwLCJleHAiOjE2MTk2MzA0MDB9.5YaORL6mWpPqgAb6IbWChm4MQo14obOU8LFWbfCEHR0",
        "colorRGB": [
            0,
            0,
            0
        ]
    }
}

Export

When you export your Segmentation mask annotations from Labelbox, the export file will contain the following information for each Segmentation mask.

Parameter

Asset type supported

Description

schemaId

Image

The ID of the schema containing all of the information needed for rendering your annotation.

featureId

Image

ID of the annotation.

title

Image

Name of the annotation in the ontology.

color

Image

Color of the annotation in the ontology.

instanceURI

Image

Annotation information hosted on Labelbox servers.

{
    "featureId": "ck9bmetz800340za5k073bm7w",
    "schemaId": "ck9blmq1lnlxz08892qqlmxto",
    "title": "Orange bird",
    "value": "orange_bird",
    "color": "#2BFF00",
    "instanceURI": "https://api.labelbox.com/masks/feature/ckmuuw2tq00053g68rbwjpoim?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjazUycnZ4MWtxYXpiMDc3MDBtcTI3eDRsIiwib3JnYW5pemF0aW9uSWQiOiJjazUycnZ4MG1wdzRnMDc2NndncXZqdGw5IiwiaWF0IjoxNjE3MDM4NDAwLCJleHAiOjE2MTk2MzA0MDB9.5YaORL6mWpPqgAb6IbWChm4MQo14obOU8LFWbfCEHR0"
}