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_labels
can only be the final "leaf" nodes.type
:linked
required
: Forimageannotation
,segmentannotation
,videoannotation
, andvideoplaybackannotation
tasks, 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 alinked
attribute 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.
{
"geometries": {
...
},
"annotation_attributes": {
"example_linked_attribute": {
"type": "linked",
"description": "What is this object connected to?",
"allowed_labels": [
"Truck",
"Car"
],
"required": true
}
}
...
}
// 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"
}
]
}