class Label(DynamicEmbeddedDocument): (source)
Known subclasses: fiftyone.core.labels.Classification
, fiftyone.core.labels.Classifications
, fiftyone.core.labels.Detection
, fiftyone.core.labels.Detections
, fiftyone.core.labels.GeoLocation
, fiftyone.core.labels.GeoLocations
, fiftyone.core.labels.Heatmap
, fiftyone.core.labels.Keypoint
, fiftyone.core.labels.Keypoints
, fiftyone.core.labels.Polyline
, fiftyone.core.labels.Polylines
, fiftyone.core.labels.Regression
, fiftyone.core.labels.Segmentation
, fiftyone.core.labels.TemporalDetection
, fiftyone.core.labels.TemporalDetections
, fiftyone.core.labels._HasAttributesDict
, fiftyone.core.labels._HasID
Base class for labels.
Label instances represent a logical collection of data associated with a particular task for a sample or frame in a dataset.
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. |
fiftyone.core.labels._HasAttributesDict
Deletes the attribute with the given name.
Parameters | |
name | the attribute name |
Raises | |
AttributeError | if the attribute does not exist |
fiftyone.core.labels._HasAttributesDict
Gets the value of the attribute with the given name.
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._HasAttributesDict
Determines whether the label has an attribute with the given name.
Parameters | |
name | the attribute name |
Returns | |
True/False |
fiftyone.core.labels._HasAttributesDict
Returns an iterator over the custom attributes of the label.
Returns | |
a generator that emits (name, value) tuples |
fiftyone.core.labels._HasAttributesDict
Sets the value of the attribute with the given name.
The attribute will be declared if it does not exist.
Parameters | |
name | the attribute name |
value | the value |