Scale
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 support
You may use
You define the type of the attribute using the
The format for
Annotation Attribute Types
Attribute Type | Description |
---|---|
Multiple choice attribute, with an optional ability to enable selecting multiple options simultaneously. | |
Integer input | |
Input to select a value between 0 and 360 with a visual interface supporting angles. | |
Input for free text | |
Input to select width or height within a box annotation |
Request Format
To create a task with attributes, simply add the
Example task payload for an `annotation` task
{
"callback_url": "http://www.example.com/callback",
"instruction": "Draw boxes around the vehicles in the image.",
"attachment_type": "image",
"attachment": "http://i.imgur.com/v4cBreD.jpg",
"geometries": {
"box": {
"objects_to_annotate": ["car","pedestrian"],
}
}
"annotation_attributes": {
"parked": {
"description": "Is the car currently parked?",
"choices": [
"Yes",
"No"
]
},
"heading": {
"description": "Which direction is the car heading",
"choices": [
"left",
"right",
"back",
"front"
],
"conditions": {
"label_condition": {
"label": "car"
},
"attribute_conditions": [
{
"parked": "No"
}
]
}
}
}
}
Response Format
In addition to the standard attributes for the annotation response, if you specified
📘 See the Callback Section for more details about callbacks.
Example response with attributes is below:
{
"response": {
"annotations": [
{
"left": 123,
"top": 10,
"width": 121,
"height": 39,
"label": "car",
"attributes": {
"parked": "Yes",
"heading": "left"
}
},
{
"left": 82,
"top": 56,
"width": 64,
"height": 30,
"label": "car",
"attributes": {
"parked": "No",
"heading": "front"
}
},
{ ... },
{ ... }
]
},
"task_id": "5774cc78b01249ab09f089dd",
"task": {
// populated task for convenience
...
}
}
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.
Example of a numerical attribute.
{
"geometries": {
...
},
"annotation_attributes": {
"example_number": {
"type": "number",
"description": "What is the answer to this example question?",
"min": 0,
"max": 100
}
}
}
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
Example of a categorical attribute.
{
"geometries": {
...
},
"annotation_attributes": {
"example_attribute": {
"type": "category",
"description": "What is the answer to this example question?",
"choices": [
"Answer1",
"Answer2"
],
"allow_multiple": true
}
}
...
}
Response Examples
Response Examples
{
"example_attribute": "Answer1"
}
{
"example_attribute": [
"Answer1",
"Answer2"
]
}
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 from
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.
Example of a angle attribute.
{
"geometries": {
...
},
"annotation_attributes": {
"example_angle": {
"type": "angle",
"description": "What is the angle of this object?",
}
}
}
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.
Example of a text attribute.
{
"geometries": {
...
},
"annotation_attributes": {
"example_text": {
"type": "text",
"description": "What does this sign say?",
}
}
}
X/Y Offset Attributes
X/Y offset attributes are supported for
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"
Example definition of an X/Y offset attribute:
{
"geometries": {
...
},
"annotation_attributes": {
"center": {
"type": "x_line",
"description": "Where is the center of the vehicle?",
}
}
}
Example response with X/Y offset attributs:
{
"response": {
"annotations": [
{
"left": 123,
"top": 10,
"width": 121,
"height": 39,
"label": "car",
"attributes": {
"center": 60
}
}
]
}
}
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:linked
- required: 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.
If the linked attribute has a value, the value of the attribute will be the annotation UUID of the object it was linked to. If the linked attribute is not used, the linked attribute will not be included in the response at all.
Example of a linked attribute.
{
"geometries": {
...
},
"annotation_attributes": {
"example_linked_attribute": {
"type": "linked",
"description": "What is this object connected to?",
"allowed_labels": [
"Truck",
"Car"
],
"required": true
}
}
...
}
Example of Linked Attribute Response
// This example shows two polygons representing friends.
// The first has no linked friends. The second example is linked to the first.
{
"annotations": [
{
"label": "Friend",
"uuid": "a6092706-266d-4de1-8a14-fa6c682a57ea",
"vertices": [
{
"x": 360.73736572265625,
"y": 200.52745056152344
},
{
"x": 365.7757263183594,
"y": 348.65576171875
},
{
"x": 510.88104248046875,
"y": 295.24896240234375
},
{
"x": 468.55865478515625,
"y": 176.34324645996094
}
],
"geometry": "polygon"
},
{
"label": "Friend",
"attributes": {
"friend": "a6092706-266d-4de1-8a14-fa6c682a57ea"
},
"uuid": "c6e00dc4-a3c0-4d48-9203-8f02d9c76328",
"vertices": [
{
"x": 619.7100219726562,
"y": 166.2664794921875
},
{
"x": 443.36676025390625,
"y": 255.94961547851562
},
{
"x": 507.8580017089844,
"y": 367.8016052246094
},
{
"x": 693.2703247070312,
"y": 313.3871154785156
}
],
"geometry": "polygon"
}
]
}
Global Attributes
Using the
For
For
For
Example attribute specification for image annotation and segment annotation tasks
{
"annotation_attributes": {
"is_night": {
"type": "category",
"description": "Does this scene take place at night?",
"choices": ["Yes", "No"],
"conditions": {
"is_global": true
}
}
}
}
Conditionality
The
Definition: Conditions
The
Definition: Condition
A
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
The
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.
e.g.
The
Example `conditions` parameter
"conditions": {
"label_condition": {
"label": ["Car", "Truck", "Motorcycle"]
},
"attribute_conditions": [{ "is_moving": "No" }, { "is_parked": "Yes" }]
}
Example `Condition` objects
// condition for the label being equal to vehicle
{ "label": "vehicle" }
// condition for the label to be equal to either car or truck
{ "label": ["car", "truck"] }
// condition for the is_parked attribute to be equal to be Yes
{ "is_parked": "Yes" }
Example of Conditions
{
...,
"geometries": {
...
},
"annotation_attributes": {
"occlusion": {
"description": "What percent of the object is occluded?",
"choices": ["0%", "25%", "50%", "75%"],
"conditions": {
"label_condition": {
"label": ["Car", "Truck", "Motorcycle"]
}
}
}
},
...,
}
Global Track Attributes (Multiframe Tasks)
For
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 in
Global Track Attributes (Multiframe Tasks) specify one attribute of annotations when using multiframe tasks, like
Example attribute specification for a global attribute
{
"annotation_attributes": {
"car_color": {
"type": "category",
"description": "What is the color of the car?",
"choices": ["red", "green", "blue"],
"global": true,
}
}
}