Skip to main content
POST
Add Segmentation Annotations
Click for Python SDK
When uploading a mask annotation, Nucleus expects the mask file to be in PNG format. Currently, Nucleus only supports uploading masks from URL (local upload coming soon). For each mask, specify the mask_url, as well as the DatasetItem you are annotating. A DatasetItem can be referenced by either its internal ID, or the reference ID you provided when uploading the image. Nucleus automatically enforces the constraint that each DatasetItem can have at most one ground truth segmentation mask. As a consequence, if during upload a duplicate mask is detected for a given image, by default it will be ignored. You can change this behavior by setting the optional update boolean to true, which will replace the existing segmentation with the new mask specified in the request body.

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

dataset_id
string
required

The Scale-generated ID of the Dataset.

Body

application/json
segmentations
object[]
required

An array of SegmentationAnnotation objects.

update
boolean
default:false

Whether to overwrite existing annotation masks upon annotation_id and reference_id collision.

Response

200

dataset_id
string
Example:

"ds_bw6de8s84pe0vbn6p5zg"

annotations_processed
integer
default:0
Example:

2

annotations_ignored
integer
default:0
Example:

0

annotations_errored
integer
default:0
Example:

0