Skip to main content

Image Annotation Overview

This is the recommended task type for annotating images with vector geometric shapes. The available geometries are box, polygon, line, point, cuboid, and ellipse.
This endpoint creates an imageannotation task. Given an image, Scale will annotate the image with the geometries you specify.
The required parameters for this task are attachment and geometries.
Body Params
object
project
string
The name of the project to associate this task with.
batch
string
The name of the batch to associate this task with. Note that if a batch is specified, you need not specify the project, as the task will automatically be associated with the batch’s project. For Scale Rapid projects specifying a batch is required. See Batches section for more details.
instruction
string
A markdown-enabled string or iframe embedded Google Doc explaining how to do the task. You can use markdown to show example images, give structure to your instructions, and more. See our instruction best practices for more details. For Scale Rapid projects, DO NOT set this field unless you specifically want to override the project level instructions.
callback_url
string
The full url (including the scheme http:// or https://) or email address of the callback that will be used when the task is completed.
attachment
string
required
A URL to the image you’d like to be annotated.
context_attachments
array of objects
An array of objects in the form of {“attachment”: “<link to actual attachment>”} to show to taskers as a reference. Context images themselves can not be labeled. Context images will appear like this in the UI. You cannot use the task’s attachment url as a context attachment’s url.
geometries
object
required
This object is used to define which objects need to be annotated and which annotation geometries (box, polygon, line, point, cuboid, or ellipse) should be used for each annotation. Further description of each geometry can be found in each respective section below
annotation_attributes
object
This field is used to add additional attributes that you would like to capture per annotation. See Annotation Attributes for more details about annotation attributes.
Use this field to define links between annotations. See Links for more details about links.
hypothesis
object
Editable annotations that a task should be initialized with. This is useful when you’ve run a model to prelabel the task and want annotators to refine those prelabels. Must contain the annotations field, which has the same format as the annotations field in the response.
layer
object
Read-only annotations to be pre-drawn on the task. See the Layers section for more details.
base_annotations
boolean
Editable annotations, with the option to be “locked”, that a task should be initialized with. This is useful when you’ve run a model to prelabel the task and want annotators to refine those prelabels. Must contain the annotations field, which has the same format as the annotations field in the response.
can_add_base_annotations
boolean
Whether or not new annotations can be added to the task if base_annotations are used. If set to true, new annotations can be added to the task in addition to base_annotations. If set to false, new annotations will not be able to be added to the task.
can_edit_base_annotations
boolean
Whether or not base_annotations can be edited in the task. If set to true, base_annotations can be edited by the tasker (position of annotation, attributes, etc). If set to false, all aspects of base_annotations will be locked.
can_edit_base_annotation_labels
boolean
Whether or not base_annotations labels can be edited in the task. If set to true, the label of base_annotations can be edited by the tasker. If set to false, the label will be locked.
can_delete_base_annotations
boolean
Whether or not base_annotations can be removed from the task. If set to true, base_annotations can be deleted from the task. If set to false, base_annotations cannot be deleted from the task.
image_metadata
object
This field accepts specified image metadata, supported fields include:
- date_time - displays the date and time the image is taken
- resolution - configures the units of the ruler tools, resolution_ratio holds the number of resolution_units corresponding to one pixel; e.g. \{resolution_ratio: 3, resolution_unit: 'm'\}, one pixel in the image corresponds to three meters in the real world.
- location - the real-world location where this image was captured, in the standard geographic coordinate system; e.g. \{lat: 37.77, long: -122.43\}

metadata
object
A set of key/value pairs that you can attach to a task object. It can be useful for storing additional information about the task in a structured format. Max 10KB. See the Metadata section for more detail.
padding
integer

paddingX
integer
The amount of padding in pixels added to the left and right of the image. Overrides padding if set.
paddingY
integer
The amount of padding in pixels added to the top and bottom of the image. Overrides padding if set.
priority
integer
A value of 10, 20, or 30 that defines the priority of a task within a project. The higher the number, the higher the priority.
unique_id
string
A arbitrary ID that you can assign to a task and then query for later. This ID must be unique across all projects under your account, otherwise the task submission will be rejected. See Avoiding Duplicate Tasks for more details.
clear_unique_id_on_error
boolean
If set to be true, if a task errors out after being submitted, the unique id on the task will be unset. This param allows workflows where you can re-submit the same unique id to recover from errors automatically
tags
array of strings
Arbitrary labels that you can assign to a task. At most 5 tags are allowed per task. You can query tasks with specific tags through the task retrieval API.

Boxes

Given a box entry in params.geometries, Scale will annotate your image or video with boxes and return the position and dimensions of the boxes.
Request Parameters
object
objects_to_annotate
array of strings
A list of string or LabelDescription objects.
min_height
integer
The minimum height in pixels of the bounding boxes you’d like to be made.
min_width
integer
The minimum width in pixels of the bounding boxes you’d like to be made.
can_rotate
boolean
Allows a tasker to rotate the bounding box.
integer_pixels
boolean
Response fields denoting box location and size (top, left, width, height) will be returned as integers instead of floats. This does not work with rotated boxes.

Response Fields

If can_rotate was set to true, the following fields will supersede the above fields:

Polygons

Given a polygon entry in params.geometries, Scale will annotate your image or video with polygons and return the vertices of the polygons.
Request Parameters
object
objects_to_annotate
array of objects
A list of string or LabelDescription objects.
min_vertices
integer
The minimum number of vertices in a valid line annotation for your request.
max_vertices
integer
The maximum number of vertices in a valid line annotation for your request. Must be at least min_vertices.

Response Fields

**Definition: **Vertex

Lines

Given a line entry in params.geometries, Scale will annotate your image or video with polylines (segmented lines) and return the vertices of the lines.
Request Parameters
object
objects_to_annotate
array of objects
A list of string or LabelDescription objects.
min_vertices
integer
The minimum number of vertices in a valid line annotation for your request.
max_vertices
integer
The maximum number of vertices in a valid line annotation for your request. Must be at least min_vertices.

Response Fields

Definition: Vertex

Ellipses

Given an ellipse entry in params.geometries, Scale will annotate your image or video with ellipses and return the extremal points of the ellipses. The ellipses may be rotated relative to the X and Y axes.
Request Parameters
object
objects_to_annotate
array of objects
A list of string or LabelDescription objects.

Response Fields

Cuboids

Given a cuboid entry in params.geometries, Scale will annotate your image or video with perspective cuboids and return the vertices of the cuboids. If camera intrinsics and extrinsics are provided as well, Scale will return scale-invariant 3D coordinates with respect to the camera, i.e. assuming the camera is at the origin. See https://scale.com/blog/3d-cuboids-annotations for a detailed explanation of how we can augment 2D cuboid responses.
Request Parameters
object
objects_to_annotate
array of objects
A list of string or LabelDescription objects.
min_height
integer
The minimum height in pixels of the cuboids you’d like to be made.
min_width
integer
The minimum width in pixels of the cuboids you’d like to be made.
camera_intrinsics
object
An object that defines camera intrinsics, in format \{fx: number, fy: number, cx: number, cy: number, scalefactor: number, skew: number\} (skew defaults to 0, scalefactor defaults to 1). scalefactor is used if the image sent is of different dimensions from the original photo (if the attachment is half the original, set scalefactor to 2) to correct the focal lengths and offsets. Use in conjunction with camera_rotation_quaternion and camera_height to get perspective-corrected cuboids and 3d points.
camera_rotation_quaternion
object
Object that defines the rotation of the camera in relation to the world. Expressed as a quaternion, in format \{w: number, x: number, y: number, z: number\}. Use in conjunction with camera_intrinsics to get perspective-corrected cuboids and 3d points. Note that the z-axis of the camera frame represents the camera’s optical axis. Use in conjunction with camera_intrinsics and camera_height to get perspective-corrected cuboids and 3d points.
camera_height
integer
The height of camera above the ground, in meters. Use in conjunction with camera_rotation_quaternion and camera_intrinsics to get perspective-corrected cuboids and 3d points.

Response Fields

Definition: Vertex

Definition: Edge

Image Response Format

The response field, which is part of the callback POST request and permanently stored as part of the task object, will contain an annotations field (and a global_attributes field, if Global Attributes were specified in the task creation request). The annotations field will contain an array of Annotation objects. The schema of each Annotation object depends on the Geometry of the Annotation. See the Boxes, Polygons, Lines, Points, Cuboids, and Ellipses sections for descriptions of the schemas.

Image Annotation Hypothesis

When creating a imageannotation task, you can provide prelabels in the hypothesis field, so that workers don’t have to start from scratch to annotate the image. In order to add pre-labels in a task using hypothesis, you’ll need to provide these in the hypothesis field of the payload when creating the task. The schema of the hypothesis object must match the schema of the task response.
  1. Verify the task response field schema for the desired task type.
  2. Review your project taxonomy (label names, attribute conditions, annotation types, etc).
  3. Generate pre-labels that are formatted to match the aforementioned schema and taxonomy.
  4. Create a task, including a hypothesis field that contains the pre-labels at the same top-level as other task fields such as project and instructions.
The hypothesis format will largely mirror Scale’s task response format. In this particular task type, annotations field array is mandatory inside the hypothesis object for simple annotations. Note: UUIDs are not mandatory, if you want to use a particular UUID to track an annotation you can add it to the hypothesis, if not, Scale will generate one for you. _For Image Annotation, you can also add Global Attributes in the hypothesis object at the same level of annotations in the _global_attributes field.

Video Annotation Overview

Note: Scale VideoAnnotation has been deprecated in favor of Video V2 (/task/videoplayback).

Note: Scale Video is only available for our Enterprise customers. If you want to learn more, please contact our sales team. This endpoint creates a videoannotation task. Given a series of images sampled from a video (which we will refer to as “frames”), Scale will annotate each frame with the Geometries (box, polygon, line, point, cuboid, and ellipse) you specify. The required parameter for this task is geometries. You can optionally provide additional markdown-enabled or Google Doc-based instructions via the instruction parameter. You may also optionally specify events_to_annotate, a list of strings describing events section to annotate in the video. If the request is successful, Scale will return the generated task object, at which point you should store the task_id to have a permanent reference to the task.

Label Nesting and Options

There are often annotation tasks that have too many label choices for a tasker to efficiently sort through them all at once, or times when you want to show one version of a label name to a tasker, but would like another version in the response. In those cases, you can utilize LabelDescription objects to support nested labels, where labels may have subcategories within them, as well as setting display values for the label. When declaring objects_to_annotate in your task parameters, we accept a mixed array of strings and the more complex LabelDescription objects.


Definition: LabelDescription

A simple example is illustrated in the example JSON below, where objects_to_annotate can simply be a string, a nested label with choices and subchoices, or a nested label where the subchoices themselves are LabelDescription objects with a display value. While there may be a large number of total labels, using subchoices a tasker can first categorize an object as a road, pedestrian, or vehicle, and based on that choice, further select the specific type of pedestrian or vehicle. Nested labels may be specified both for the object labels (the objects_to_annotate array parameter), as well as in the choices array of a categorical annotation attribute. In both cases, you would specify a nested label by using a LabelDescription object instead of a string. For example, for an objects_to_annotate array of \["Vehicle", "Pedestrian"\], you could instead add a nested label by passing an array, like \["Vehicle", \{"choice": "Pedestrian", "subchoices": \["Animal", "Adult", "Child"\]\}\]. Then, if a tasker selected “Pedestrian” for an annotation, they would be further prompted to choose one of the corresponding subchoices for that annotation. The LabelDescription object has the following structure: