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)
Parameter | Type | Description |
---|---|---|
dataset_id | str | The dataset id |
dataset_version_id | str | The dataset version id |
annotation | Annotation | The annotation object |
Annotation properties in detail:
Property | Type | Description |
---|---|---|
id | str | Unique id |
created_at | str | The creation date |
updated_at | str | Last updated date |
label_id | str | The label ID the annotation belongs to |
item_id | str | The dataset item ID the annotation belongs to |
split_id | str | The dataset split ID the annotation belongs to |
coordinates | str | The coordinates of the annotation, used for object_detection and ner . |
user_id | str | The 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)
Parameter | Type | Description |
---|---|---|
dataset_id | str | The dataset id |
dataset_version_id | str | The dataset version id |
annotation | Annotation | The annotation object |
Delete an annotation
Delete a given annotation
client.delete_annotation(my_dataset.id, new_dataset_version.id, annotation.id)
Parameter | Type | Description |
---|---|---|
dataset_id | str | The dataset id |
dataset_version_id | str | The dataset version id |
annotation_id | str | The annotation object |