Documentation Index
Fetch the complete documentation index at: https://api-reference.scale.com/llms.txt
Use this file to discover all available pages before exploring further.
Annotation Attributes Overview
In many cases, it is useful to have more human-judged metadata on top of each annotation for a given task, for example, measuring the occlusion-level of all vehicles in an image. To achieve this, we supportannotation_attributes, an object representing additional attributes that you’d like to capture per image annotation.
You may use annotation_attributes to define categorical attributes, numerical attributes, angle attributes, text attributes and more for each annotation.
You define the type of the attribute using the type property of the attribute, if no type is specified, it will default to a category type attribute. See the Annotation Attribute Types below for more details.
The format for annotation_attributes is an object whose key-value pairs all specify attributes of each annotation that you want to capture. The schema differs slightly based on the type of attribute.
Annotation Attribute Types
| Attribute Type | Description |
|---|---|
| Categorical | Multiple choice attribute, with an optional ability to enable selecting multiple options simultaneously. |
| Numerical | Integer input |
| Angle | Input to select a value between 0 and 360 with a visual interface supporting angles. |
| Text | Input for free text |
| X/Y Offset | Input to select width or height within a box annotation |
Request Format
To create a task with attributes, simply add theannotation_attributes parameter to your task creation request using the format described above.
Response Format
In addition to the standard attributes for the annotation response, if you specifiedannotation_attributes in the request, each annotation object will contain an attributes JSON. It will contain keys for each of the attributes you defined in the annotation_attributes schema, and the values will be the categorical value or numerical value chosen by a labeler.
📘 See the Callback Section for more details about callbacks.
Numerical Attributes
- key: a short string that serves as the identifier for the attribute
-
value: an object that should have the following keys:
description: a human-readable string describing the attribute to a labeler.type: a string describing the type of attribute. Must benumberfor numerical attributes.min(optional): The minimum number that may be chosen as the attribute.max(optional): The maximum number that may be chosen as the attribute.step(optional, default1): The legal number intervals for the attribute.conditions(optional): a JSON that describes the conditions under which this attribute should be collected.
Categorical Attributes
Each key-value defining a categorical attribute should have the following structure:- key: a short string that serves as the identifier for the attribute
-
value: an object that should have the following keys:
description: a human-readable string describing the attribute to a labeler.choices: a list of strings or LabelDescription objects corresponding to the categorical choices.type(defaultcategory): a string describing the type of attribute. Must becategoryfor categorical attributes.conditions(optional): a JSON that describes the conditions under which this attribute should be collected.allow_multiple(optional): a boolean value, iftrue, allows multiple values to be selected. The response will be an array of values.
Request Example
Response Examples
Angle Attributes
An angle attribute allows you to receive some angular information of the attribute, such as the heading yaw angle or heading pitch angle. This will return a number from0 to 360, which is the value of the angle in degrees.
Each key-value defining an angle attribute should have the following structure:
- key: a short string that serves as the identifier for the attribute
-
value: an object that should have the following keys:
description: a human-readable string describing the attribute to a labeler.type: a string describing the type of attribute. Must beanglefor angle attributes.conditions(optional): a JSON that describes the conditions under which this attribute should be collected.
Text Attributes
A text attribute allows you to receive freeform text, such as a transcription of a road sign or a car’s license plate. This will return a string. Each key-value defining a text attribute should have the following structure:- key: a short string that serves as the identifier for the attribute
-
value: an object that should have the following keys:
description: a human-readable string describing the attribute to a labeler.type: a string describing the type of attribute. Must betextfor text attributes.conditions(optional): a JSON that describes the conditions under which this attribute should be collected.
X/Y Offset Attributes
X/Y offset attributes are supported forbox and cuboid geometries and represent some x- or y-offset within the annotation. They may be used to mark key positions such as the center of the annotated object.
In visual representations of task responses, they will be rendered as a horizontal/vertical lines across the annotation.
Each key-value defining an X/Y offset attribute should have the following structure:
- key: a short string that serves as the identifier for the attribute
-
value: an object that should have the following keys:
description: a human-readable string describing the attribute to a labeler.type:"x_line"or"y_line"
Linked Attributes
Linked attributes are used to link one annotation in a task to another annotation - for example, specifying the car that a tire belongs to. Each key-value defining a linked attribute should have the following structure:- key: a short string that serves as the identifier for the attribute
-
value: an object that should have the following keys:
description: a human-readable string describing the attribute to a labeler.allowed_labels: a list of strings corresponding to the label choices this object can be linked to. If using Label Nesting, the strings inallowed_labelscan only be the final “leaf” nodes.type:linkedrequired: Forimageannotation,segmentannotation,videoannotation, andvideoplaybackannotationtasks, a boolean value representing whether this attribute is required to be annotated. Defaults tofalse. Note that for 3d Sensor Fusion Tasks, this option is not supported. For Sensor Fusion tasks, specifying alinkedattribute will require an object to be linked before a task can be returned to you.conditions(optional): a JSON that describes the conditions under which this attribute should be collected. See Conditionality for more details.
Global Attributes
Using the"is_global": true flag in the conditions JSON when defining attributes marks the attribute as global.
For imageannotation and segmentannotation tasks, this means the attribute applies to the scene as a whole instead of any particular annotation. Therefore, the label_condition condition will never apply.
For videoannotation and videoplaybackannotation tasks, this means the attribute applies to events which occur on a frame or during a group of frames. The label_condition can be used to restrict the attribute to appear on specific event labels.
For imageannotation tasks, the global attribute image_rotation will sync with the image rotation in the task.
Conditionality
Theconditions JSON describes the set of conditions under which the attribute should be collected. Each of these conditions objects described in the JSON are OR’d together, and each property within these objects is AND’d together.
Definition: Conditions
The conditions object describes which labels and attributes to ask for based on already provided responses. conditions can have up to two key-values: label_condition and attribute_conditions.
Definition: Condition
A Condition is an object defined by a single key and a value. The key describes the semantic string that you want to check, whether it is 'label' for the label_condition or the attribute identifier for attribute_conditions.
The value is either a string or an array of strings. In the case of a string, the label or attribute will be checked for strict equality with the string. In the case of an array of strings, the label or attribute will be checked for membership within the array.
Condition Parameters
Thelabel_condition key-value will describe the label or labels that you want to collect this attribute for. The value is a Condition object, which must have a key equal to 'label' and a value corresponding to the label or furthest “leaf” node / subchoice of a LabelDescription object.
For example, if in the above example, you wanted an “occlusion” attribute for some mix of the “leaf” labels, you could specify the label condition for the attribute as e.g. \{ "label": \["Car", "Truck", "Motorcycle", "Adult"\] \}. If you wanted the attribute to be conditional on all the subchoices of a given label (e.g., all “Vehicle”s), you would simply specify all of those subchoices in the array,e.g.
\{ "label": \["Car", "Truck", "Train", "Motorcycle"\] \}.
The attribute_conditions key-value will describe under what conditions with the other attributes you’d like to collect this attribute for. The value should be a Condition object or a list of Condition objects.
attribute_conditions are automatically verified for circular dependencies, and tasks will be rejected if any circular dependencies are found.
Global Track Attributes (Multiframe Tasks)
Forvideoannotation, videoplaybackannotation, and lidarannotation tasks, using the "global": true flag when defining attributes marks an attribute as a global track attribute. This means the attribute’s value will be constant across the entire object track, instead of being allowed to vary from frame to frame.
Multiple Types of “Global” Attributes
Global Attributes (here) are different from Global Track Attributes for Multiframe Tasks. Global Attributes specify a global, scene-level attribute, or an attribute of events if using events invideoannotation or videoplaybackannotation tasks. It is not used to customize the attributes of a single annotation.
Global Track Attributes (Multiframe Tasks) specify one attribute of annotations when using multiframe tasks, like videoannotation or videoplaybackannotation. Once set, all frames of the annotation must have the same, consistent attribute value. Global Track Attributes should only be used to specify annotation attributes of videoannotation , videoplaybackannotation or lidarannotation tasks.