2.3.13 Labels

Labels are used to describe the events your application will be detecting. Each label will have a subset of label values that can be assigned to any segment of data that you are annotating. For example, you might create a label called “Activity” that has multiple label values, such as Walking, Running, Sitting, Standing, etc. Projects can have multiple labels each having their own set of label values.

Examples:

from mplabml.datamanager.label import LabelSet
from mplabml.datamanager.labelvalue import LabelValueSet

# gets the set of labels associated with this project
label_set = LabelSet(client._connection, client._project)


# get the first label object
label = label_set.labels[0]
label.name

# gets the set of label values associated with the label
label_values_set = LabelValueSet(client._connection, client._project, label)

print(label_values_set)
class mplabml.datamanager.label. Label(connection, project)

Base class for a label object.

delete()

Calls the REST API and deletes the object from the server

initialize_from_dict(data)

Reads a json dictionary and populates a single metadata object

Parameters

data (dict) – contains the uuid, name, type

insert()

Calls the REST API and inserts a metadata object onto the server using the local object’s properties

property name

The name property of the metadata object

refresh()

Calls the REST API and populates the local object’s properties from the server

update()

Calls the REST API and updates the object on the server

property uuid

Auto generated unique identifier for the metadata object

property value_type

The data type of the metadata object

class mplabml.datamanager.labelvalue. LabelValue(connection, project, label)

Base class for a label object.

property created_at

The created time of the label value object

delete()

Calls the REST API and deletes the object from the server

initialize_from_dict(data)

Reads a json dictionary and populates a single metadata object

Parameters

dict (dict) – contains the uuid, value

insert()

Calls the REST API and inserts a metadata object onto the server using the local object’s properties

refresh()

Calls the REST API and populates the local object’s properties from the server

update()

Calls the REST API and updates the object on the server

property uuid

Auto generated unique identifier for the label value object

property value

The data type of the label value object