Properties
Methods
update
update(
name: str = None, group_id: UUID = None
)
Description
Update this Label with a new name or with a new group.
Examples
a_label.update(name="new name")
Arguments
delete
delete()
Description
Delete this Label from the platform.
All annotations shape with this label will be deleted!
This is a very dangerous move.
⚠️ DANGER ZONE: Be very careful here!
Examples
this_label.delete()
get_group
get_group()
Description
Get (LabelGroup) parent of this Label. If no (LabelGroup) is set, return None.
Examples
group = label_1.get_group()
label_2.set_group(group)
Returns
a (LabelGroup) if there is a parent, else None
set_group
set_group(
group: LabelGroup
)
Description
Update this Label with a new group.
Examples
a_label.update(name="new name")
Arguments
- group (LabelGroup) : new group of this Label
get_skeleton
get_skeleton()
Description
Get the skeleton of this Label.
Returns
a dict with key edges and vertices
set_skeleton
set_skeleton(
vertices: list[str], edges: list[list[int]]
)
Description
Set the skeleton of this Label.
Arguments
-
vertices (list[str]) : names of this skeleton vertices
-
edges (list of 2 ints) : edges are links between vertices with indexes starting at 1!
get_attributes
get_attributes()
Description
Get attributes configuration of this Label.
Returns
a dict with attributes
set_attributes
set_attributes(
attributes: (dict|None)
)
Description
Set attributes configuration of this Label.
The attributes parameter is a dict mapping attribute names (str) to their
configuration. Each attribute configuration is a dict with the following fields:
-
display_name(str | None): Optional display name (1-256 chars). -
required(bool): Whether the attribute is required. -
input_type(str): One of "STRING", "INTEGER", "FLOAT", "BOOLEAN". -
archived(bool): Whether the attribute is archived (default False). An archived attribute cannot be required. -
choices(list | None): Optional list of allowed values (not available for BOOLEAN).
When defined, must have 1-64 items (2-64 for STRING). Cannot be combined with min/max. -
allow_multiple(bool | None): Whether multiple choices can be selected (requireschoices). -
min(int | float | None): Optional minimum value (INTEGER, FLOAT only). Must be less thanmax. -
max(int | float | None): Optional maximum value (INTEGER, FLOAT only). Must be greater thanmin.
Example
: {
"display_name": "Color",
"required": True,
"input_type": "STRING",
"choices": ["red", "green", "blue"],
"allow_multiple": True,
},
"score": {
"display_name": "Score",
"required": False,
"input_type": "FLOAT",
"min": 0.0,
"max": 1.0,
},
"count": {
"display_name": "Count",
"required": False,
"input_type": "INTEGER",
"choices": [1, 2, 3, 4, 5],
"allow_multiple": False,
},
"is_valid": {
"display_name": "Is Valid",
"required": True,
"input_type": "BOOLEAN",
},
label.set_attributes({
})
Args
- attributes : A dict mapping attribute names to their configuration, or None to clear all attributes.