Scale Image Layers

“Layers” can be used to specify read-only boxes, lines, polygons, and/or cuboids to be pre-drawn on an image.

For instance, you could specify boxes around the cars of an image, for a task that requires drawing polygons around the currently boxed cars. Or you could create a task for drawing boxes around all cars which you hadn't already recognized.

Layers are specified using a Layers object, which has the following keys:

  • boxes (optional): an array of box objects
  • lines (optional): an array of line objects
  • cuboids (optional): an array of cuboid objects
  • polygons (optional): an array of polygon objects
    Each of these objects is specified in the same format as the responses for their respective endpoints.
{
  ...
  "layers": {
    "boxes": [{...}],
    "lines": [{...}],
    "cuboids": [{...}],
    "polyson": [{...}],
  }
}

To specify layers for imageannotation, annotation, lineannotation, cuboidannotation, polygonannotation, pointannotation, and categorization (if the attachment_type is image) tasks, pass a Layers object using the optional layers parameter in the request.

{
  ...
  "layers": {
    "url": "https://scale-static-assets.s3.us-west-2.amazonaws.com/uploads/videoLayers.json"
}

To specify layers for videoannotation, videoboxannotation, videocuboidannotation, and videopolygonannotation 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.