Annotations

Annotations link your dataset items to one or more labels in your dataset.

Create an annotation

Create an annotation with label_id, split_id, and item_id.

annotation = Annotation(
    label_id= my_label.id,
    split_id= my_split.id,
    item_id= item.id
)

annotation = client.annotate(my_dataset.id, new_dataset_version.id, annotation)
ParameterTypeDescription
dataset_idstrThe dataset id
dataset_version_idstrThe dataset version id
annotationAnnotationThe annotation object

Annotation properties in detail:

PropertyTypeDescription
idstrUnique id
created_atstrThe creation date
updated_atstrLast updated date
label_idstrThe label ID the annotation belongs to
item_idstrThe dataset item ID the annotation belongs to
split_idstrThe dataset split ID the annotation belongs to
coordinatesstrThe coordinates of the annotation, used for object_detection and ner.
user_idstrThe unique id of the annotation creator

Update an annotation

Update a given annotation

annotation.coordinates = "14 20 34 48"

annotation = client.update_annotation(my_dataset.id, new_dataset_version.id, annotation)
ParameterTypeDescription
dataset_idstrThe dataset id
dataset_version_idstrThe dataset version id
annotationAnnotationThe annotation object

Delete an annotation

Delete a given annotation

client.delete_annotation(my_dataset.id, new_dataset_version.id, annotation.id)
ParameterTypeDescription
dataset_idstrThe dataset id
dataset_version_idstrThe dataset version id
annotation_idstrThe annotation object