“Layers” can be used to specify read-only boxes, lines, polygons, and/or cuboids to be pre-drawn on an image.
For instance, you can specify boxes around the cars of an image and instruct workers to only draw polygons around the currently boxed cars. Alternatively, you could instruct workers to only draw polygons around cars which don't already have boxes around them.
Layers are specified using a Layers
object, which has the following keys:
boxes
(optional): an array ofbox
objectslines
(optional): an array ofline
objectscuboids
(optional): an array ofcuboid
objectspolygons
(optional): an array ofpolygon
objects
Each of these objects is specified in the same format as the responses for their respective endpoints.
Layers for Image Annotation
To specify layers for imageannotation
and categorization
(if the attachment_type
is image
) tasks, pass a Layers
object using the optional layers
parameter in the request.
{
...
"attachment": "https://i.imgur.com/iDZcXfS.png",
"layers": {
"boxes": [{ ... }],
"lines": [{ ... }],
"cuboids": [{ ... }],
"polygons": [{ ... }]
}
}
Layers for Video Annotation
To specify layers for videoannotation
tasks, pass a Scale-accessible file containing an array of Layers
objects (one for each frame of the video) using the optional layers.url
parameter in the request. See https://scale-static-assets.s3.us-west-2.amazonaws.com/uploads/videoLayers.json for an example file corresponding to a video with two frames.
{
...
"attachments": ["https://i.imgur.com/iDZcXfS.png"],
"layers": {
"url": "https://scale-static-assets.s3.us-west-2.amazonaws.com/uploads/videoLayers.json"
...
}