class VideoLabelsSampleParser(LabeledVideoSampleParser): (source)
Known subclasses: fiftyone.utils.data.parsers.FiftyOneVideoLabelsSampleParser
Constructor: VideoLabelsSampleParser(prefix, labels_dict, frame_labels_dict, multilabel, skip_non_categorical)
Generic parser for labeled video samples whose labels are represented in eta.core.video.VideoLabels format.
This implementation provided by this class supports samples that are (video_path, video_labels_or_path) tuples, where:
- video_path is the path to a video on disk
- video_labels_or_path is an eta.core.video.VideoLabels instance, a serialized dict representation of one, or the path to one on disk
Parameters | |
prefix | a string prefix to prepend to each label name in the expanded sample/frame label dictionaries |
labels | a dictionary mapping names of attributes/objects in the sample labels to field names into which to expand them. By default, all sample labels are loaded |
frame | a dictionary mapping names of attributes/objects in the frame labels to field names into which to expand them. By default, all frame labels are loaded |
multilabel | whether to store attributes in a single
fiftyone.core.labels.Classifications instance |
skip | whether to skip non-categorical attributes (True) or cast them to strings (False) |
Method | __init__ |
Undocumented |
Method | clear |
Clears the current sample. |
Method | get |
Returns the frame labels for the current sample. |
Method | get |
Returns the sample-level labels for the current sample. |
Method | get |
Returns the video path for the current sample. |
Instance Variable | frame |
Undocumented |
Instance Variable | labels |
Undocumented |
Instance Variable | multilabel |
Undocumented |
Instance Variable | prefix |
Undocumented |
Instance Variable | skip |
Undocumented |
Property | frame |
The fiftyone.core.labels.Label class(es) returned by this parser within the frame labels that it produces. |
Property | has |
Whether this parser produces fiftyone.core.metadata.VideoMetadata instances for samples that it parses. |
Property | label |
The fiftyone.core.labels.Label class(es) returned by this parser within the sample-level labels that it produces. |
Method | _parse |
Undocumented |
Instance Variable | _curr |
Undocumented |
Instance Variable | _curr |
Undocumented |
Inherited from LabeledVideoSampleParser
:
Method | get |
Returns the video metadata for the current sample. |
Inherited from SampleParser
(via LabeledVideoSampleParser
):
Method | with |
Sets the current sample so that subsequent calls to methods of this parser will return information from the given sample. |
Property | current |
The current sample. |
Instance Variable | _current |
Undocumented |
Undocumented
Returns the frame labels for the current sample.
Returns | |
a dictionary mapping frame numbers to dictionaries that map label
fields to fiftyone.core.labels.Label instances for each
video frame, or None if the sample has no frame labels |
Returns the sample-level labels for the current sample.
Returns | |
a fiftyone.core.labels.Label instance, or a dictionary
mapping field names to fiftyone.core.labels.Label
instances, or None if the sample has no sample-level labels |
The fiftyone.core.labels.Label
class(es) returned by this
parser within the frame labels that it produces.
This can be any of the following:
- a
fiftyone.core.labels.Label
class. In this case, the parser is guaranteed to return frame labels of this type - a list or tuple of
fiftyone.core.labels.Label
classes. In this case, the parser can produce a single frame label field of any of these types - a dict mapping keys to
fiftyone.core.labels.Label
classes. In this case, the parser will return frame label dictionaries with keys and value-types specified by this dictionary. Not all keys need be present in each frame - None. In this case, the parser makes no guarantees about the frame labels that it may return
Whether this parser produces
fiftyone.core.metadata.VideoMetadata
instances for samples
that it parses.
The fiftyone.core.labels.Label
class(es) returned by this
parser within the sample-level labels that it produces.
This can be any of the following:
- a
fiftyone.core.labels.Label
class. In this case, the parser is guaranteed to return sample-level labels of this type - a list or tuple of
fiftyone.core.labels.Label
classes. In this case, the parser can produce a single sample-level label field of any of these types - a dict mapping keys to
fiftyone.core.labels.Label
classes. In this case, the parser will return sample-level label dictionaries with keys and value-types specified by this dictionary. Not all keys need be present in the imported labels - None. In this case, the parser makes no guarantees about the sample-level labels that it may return