class _HasAttributesDict(Label): (source)
Known subclasses: fiftyone.core.labels.Detection
, fiftyone.core.labels.Keypoint
, fiftyone.core.labels.Polyline
Mixin for Label
classes that have an attributes
field
that contains a dict of Attribute
instances.
Method | delete |
Deletes the attribute with the given name. |
Method | get |
Gets the value of the attribute with the given name. |
Method | has |
Determines whether the label has an attribute with the given name. |
Method | iter |
Returns an iterator over the custom attributes of the label. |
Method | set |
Sets the value of the attribute with the given name. |
Class Variable | attributes |
Undocumented |
Deletes the attribute with the given name.
The specified attribute may either exist in the attributes
dict
or as a dynamic attribute.
Parameters | |
name | the attribute name |
Raises | |
AttributeError | if the attribute does not exist |
Gets the value of the attribute with the given name.
The specified attribute may either exist in the attributes
dict
or as a dynamic attribute.
Parameters | |
name | the attribute name |
default:no_default | a default value to return if the attribute does not exist. Can be None |
Returns | |
the attribute value | |
Raises | |
AttributeError | if the attribute does not exist and no default value was provided |
fiftyone.core.labels.Label.has_attribute
Determines whether the label has an attribute with the given name.
The specified attribute may either exist in the attributes
dict
or as a dynamic attribute.
Parameters | |
name | the attribute name |
Returns | |
True/False |
Returns an iterator over the custom attributes of the label.
Attribute may either exist in the attributes
dict or as dynamic
attributes.
Returns | |
a generator that emits (name, value) tuples |
Sets the value of the attribute with the given name.
If the specified attribute already exists in the attributes
dict, its value is updated there. Otherwise, the attribute is
set (or created) as a dynamic attribute.
Parameters | |
name | the attribute name |
value | the value |
fiftyone.core.labels.Detection
, fiftyone.core.labels.Keypoint
, fiftyone.core.labels.Polyline
Undocumented