class LabeledVideoSampleParser(SampleParser): (source)
Known subclasses: fiftyone.utils.data.parsers.FiftyOneLabeledVideoSampleParser
, fiftyone.utils.data.parsers.FiftyOneTemporalDetectionSampleParser
, fiftyone.utils.data.parsers.VideoLabelsSampleParser
Interface for SampleParser
instances that parse labeled video
samples.
The general recipe for using LabeledVideoSampleParser
instances
is as follows:
sample_parser = LabeledVideoSampleParser(...) for sample in samples: sample_parser.with_sample(sample) video_path = sample_parser.get_video_path() label = sample_parser.get_label() frames = sample_parser.get_frame_labels() if sample_parser.has_video_metadata: video_metadata = sample_parser.get_video_metadata()
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 metadata for the current sample. |
Method | get |
Returns the video path for the current sample. |
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. |
Inherited from SampleParser
:
Method | __init__ |
Undocumented |
Method | clear |
Clears the current sample. |
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 |
fiftyone.utils.data.parsers.FiftyOneLabeledVideoSampleParser
, fiftyone.utils.data.parsers.FiftyOneTemporalDetectionSampleParser
, fiftyone.utils.data.parsers.VideoLabelsSampleParser
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 |
fiftyone.utils.data.parsers.FiftyOneLabeledVideoSampleParser
, fiftyone.utils.data.parsers.FiftyOneTemporalDetectionSampleParser
, fiftyone.utils.data.parsers.VideoLabelsSampleParser
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 |
fiftyone.utils.data.parsers.FiftyOneLabeledVideoSampleParser
, fiftyone.utils.data.parsers.FiftyOneTemporalDetectionSampleParser
Returns the video metadata for the current sample.
Returns | |
a fiftyone.core.metadata.ImageMetadata instance |
fiftyone.utils.data.parsers.FiftyOneLabeledVideoSampleParser
, fiftyone.utils.data.parsers.FiftyOneTemporalDetectionSampleParser
, fiftyone.utils.data.parsers.VideoLabelsSampleParser
Returns the video path for the current sample.
Returns | |
the path to the video on disk |
fiftyone.utils.data.parsers.FiftyOneLabeledVideoSampleParser
, fiftyone.utils.data.parsers.FiftyOneTemporalDetectionSampleParser
, fiftyone.utils.data.parsers.VideoLabelsSampleParser
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
fiftyone.utils.data.parsers.FiftyOneLabeledVideoSampleParser
, fiftyone.utils.data.parsers.FiftyOneTemporalDetectionSampleParser
, fiftyone.utils.data.parsers.VideoLabelsSampleParser
Whether this parser produces
fiftyone.core.metadata.VideoMetadata
instances for samples
that it parses.
fiftyone.utils.data.parsers.FiftyOneLabeledVideoSampleParser
, fiftyone.utils.data.parsers.FiftyOneTemporalDetectionSampleParser
, fiftyone.utils.data.parsers.VideoLabelsSampleParser
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