Label formats
When you label a sample and press the save button, you've created a label for that sample. Labels come in different types, with the available options determined by the type of the corresponding sample.
When downloading or uploading labels using the Python SDK, the format of the attributes field depends on the type of label. The different formats are described here.
A label can additionally also contain Object attributes and Image attributes.
Image
Segmentation labels
Format of the attributes field in client.get_label():
{
"format_version": "0.1",
"annotations": [
{
"track_id": 1, // the track id. A single object has the same track_id across frames. 0.
"id": 1, // this is a legacy field and is always equal to track_id.
"category_id": 1 // this is a category id
},
{
"track_id": 2,
"id": 2,
"category_id": 1
},
{
"track_id": 3,
"id": 3,
"category_id": 4
}
],
"segmentation_bitmap": {
"url": "https://segmentsai-staging.s3.eu-west-2.amazonaws.com/assets/davy/ddf55e99-1a6f-42d2-83e9-8657de3259a1.png"
}
}Thesegmentation_bitmap_urlrefers to a 32-bit RGBA png image which contains the segmentation masks. The alpha channel is set to 255, and the remaining 24-bit values in the RGB channels correspond to the object ids in the annotations list. Unlabeled regions should have a value of 0. Because of the large dynamic range, these png images may appear black in an image viewer.
Vector labels (bounding box, polygon, polyline, keypoint)
Format of the attributes field in client.get_label():
Image sequence
Segmentation labels
Format of the attributes field in client.get_label():
format_version
string
Format version.
Vector labels (bounding box, polygon, polyline, keypoint)
Format of the attributes field in client.get_label():
Where each frames object has the following format:
3D point cloud
Segmentation label
The annotations array contains the different objects ("annotations") in the label with their category (the category_id should correspond to an id defined in the categories).
The point_annotations array contains the object/annotation id for each point in the point cloud. The order of the ids in this array is the same as the order of the points in the point cloud.
Cuboid label
format_version
string
Format version.
Cuboid annotation
A cuboid annotation represents a single cuboid in a point cloud (frame).
id
integer
Object id.
category_id
integer
Category id.
type
string
Object type, which is always "cuboid" for cuboid annotations.
position
object: {
"x": float,
"y": float,
"z": float
}
XYZ position of the center of the cuboid in world coordinates.
dimensions
object: {
"x": float,
"y": float,
"z": float
}
Dimensions of the cuboid. "x" corresponds to the length, "y" to the width, and "z" to the height. See diagram 1.
yaw
float
Cuboid rotation along the z-axis in radians between [-π, π]. 0 yaw corresponds to a cuboid aligned with the x-axis pointing to increasing x-values. The yaw value increases with a counter-clockwise rotation up to π, and decreases with a clockwise rotation up to -π. See diagram 2.
rotation
object: {
"qx": float,
"qy": float,
"qz": float,
"qw": float
}
Cuboid rotation defined as a rotation quaternion. Only available when 3D rotation is enabled in the dataset settings (under "Labeling").
track_id
integer
Track ID of the object. This ID is used to track an object over multiple frames. Only relevant for sequences.
is_keyframe
boolean
Whether this cuboid annotation is a keyframe or an interpolated frame. Only relevant for sequences.
index
integer
The frame index. Only relevant for sequences.


Vector label (polygon, polyline, keypoint)
3D point cloud sequence
Segmentation label
Where each frames object has the following format:
Cuboid label
format_version
string
Format version.
Vector label (polygon, polyline, keypoint)
Format of the attributes field in client.get_label():
format_version
string
Format version.
Multi-sensor sequence
Sensor
name
string
Name of the sensor.
task_type
string
The task type of the sensor. Currently, pointcloud-cuboid-sequence and image-vector-sequence are supported.
attributes
object
The label attributes for the sensor. Currently, 3D point cloud sequence and image sequence are supported.
Object attributes
Objects in the annotations list can optionally also contain an attributes field to store object-level attributes. Make sure to properly configure the label editor if you're using object-level attributes.
Image attributes
You can also define image-level attributes. These can be useful in image classification tasks. Make sure to properly configure the label editor if you're using image-level attributes.
Links
The links are stored at the top level of the annotations.
from_id
number
Link's object/track origin
to_id
number
Link's object/track destination
attributes
object
The link attributes.
Last updated
Was this helpful?