Dataset Labels

Dataset Labels

A dataset version can have multiple labels.

Get all labels

labels = client.get_dataset_labels(my_dataset.id, new_dataset_version.id.)
ParameterTypeDescription
dataset_idstrThe dataset id
dataset_version_idstrThe 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)
ParameterTypeDescription
dataset_idstrThe dataset id
dataset_version_idstrThe dataset version id
labelLabelThe label object

Label properties in more detail:

PropertyTypeDescription
idstrUnique id for the dataset split
created_atstrThe creation date
updated_atstrLast updated date
namestrThe dataset label name
descriptionstrThe dataset label description
user_idstrThe unique id of the dataset label creator
version_idstrThe unique id of the dataset label the split belongs to
colorstrThe hex code for the color to be used/associated with this label
indexintMake sure we can always sort the labels in the same sequence (handled automatically)
shortcutstrThe 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)
ParameterTypeDescription
dataset_idstrThe dataset id
dataset_version_idstrThe dataset version id
label_idstrThe 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)
ParameterTypeDescription
dataset_idstrThe dataset id
dataset_version_idstrThe dataset version id
labelLabelThe label object

Delete a label

client.delete_dataset_label(my_dataset.id, new_dataset_version.id, my_label)
ParameterTypeDescription
dataset_idstrThe dataset id
dataset_version_idstrThe dataset version id
label_idstrThe label id