class FiftyOneLabeledVideoSampleParser(ExtractClipsMixin, LabeledVideoSampleParser): (source)
Constructor: FiftyOneLabeledVideoSampleParser(label_field, frame_labels_field, label_fcn, frame_labels_fcn, ...)
Parser for fiftyone.core.sample.Sample
instances that contain
labeled videos.
This class also supports fiftyone.core.clips.ClipView
instances.
Parameters | |
label | the name of a label field to parse, or a dictionary mapping label field names to output keys to use in the returned sample-level labels dictionary |
frame | the name of a frame label field to parse, or a dictionary mapping field names to output keys describing the frame label fields to export |
label | an optional function or dictionary mapping label field names to functions (must match label_field) to apply to each sample label before returning it |
frame | an optional function or dictionary mapping frame label field names to functions (must match frame_labels_field) to apply to each frame label before returning it |
compute | whether to compute
fiftyone.core.metadata.VideoMetadata instances on-the-fly
if get_video_metadata is called and no metadata is
available |
write | whether to write clips when get_video_path
is called |
clip | a directory to write clips. Only applicable when
parsing fiftyone.core.clips.ClipView instances |
video | the video format to use when writing video clips to disk. By default, fiftyone.config.default_video_ext is used |
Method | __init__ |
Undocumented |
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. |
Instance Variable | frame |
Undocumented |
Instance Variable | frame |
Undocumented |
Instance Variable | label |
Undocumented |
Instance Variable | label |
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. |
Static Method | _parse |
Undocumented |
Inherited from ExtractClipsMixin
:
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Instance Variable | _curr |
Undocumented |
Inherited from SampleParser
(via ExtractClipsMixin
, LabeledVideoSampleParser
):
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 |
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 |
Returns the video metadata for the current sample.
Returns | |
a fiftyone.core.metadata.ImageMetadata instance |
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