Dataset Labels
A dataset version can have multiple labels.
Get all labels
labels = client.get_dataset_labels(my_dataset.id, new_dataset_version.id.)
Parameter | Type | Description |
---|
dataset_id | str | The dataset id |
dataset_version_id | str | The dataset version id |
Create a label
new_label = Label(
name= "Birds",
description= "Adding birds to the mix"
)
new_label = client.create_dataset_label(my_dataset.id, new_dataset_version.id, new_label)
Parameter | Type | Description |
---|
dataset_id | str | The dataset id |
dataset_version_id | str | The dataset version id |
label | Label | The label object |
Label properties in more detail:
Property | Type | Description |
---|
id | str | Unique id for the dataset split |
created_at | str | The creation date |
updated_at | str | Last updated date |
name | str | The dataset label name |
description | str | The dataset label description |
user_id | str | The unique id of the dataset label creator |
version_id | str | The unique id of the dataset label the split belongs to |
color | str | The hex code for the color to be used/associated with this label |
index | int | Make sure we can always sort the labels in the same sequence (handled automatically) |
shortcut | str | The shortcut character that can be used during labelling in the UI |
Get a label
my_label = client.get_dataset_label(my_dataset.id, new_dataset_version.id, new_label.id)
Parameter | Type | Description |
---|
dataset_id | str | The dataset id |
dataset_version_id | str | The dataset version id |
label_id | str | The label id |
Update a label
my_label.color = "#00ff00"
my_label = client.update_dataset_label(my_dataset.id, new_dataset_version.id, my_label.id)
Parameter | Type | Description |
---|
dataset_id | str | The dataset id |
dataset_version_id | str | The dataset version id |
label | Label | The label object |
Delete a label
client.delete_dataset_label(my_dataset.id, new_dataset_version.id, my_label)
Parameter | Type | Description |
---|
dataset_id | str | The dataset id |
dataset_version_id | str | The dataset version id |
label_id | str | The label id |