«
class documentation

Parser for samples in FiftyOne temporal detection datasets.

See :ref:`this page <FiftyOneTemporalDetectionDataset-import>` for format details.

Parameters
classesan optional list of class label strings. If provided, it is assumed that target is a class ID that should be mapped to a label string via classes[target]
compute_metadatawhether to compute fiftyone.core.metadata.VideoMetadata instances on-the-fly if get_video_metadata is called and no metadata is available
Method __init__ Undocumented
Method clear_sample Clears the current sample.
Method get_frame_labels Returns the frame labels for the current sample.
Method get_label Returns the sample-level labels for the current sample.
Method get_video_metadata Returns the video metadata for the current sample.
Method get_video_path Returns the video path for the current sample.
Method with_sample Sets the current sample so that subsequent calls to methods of this parser will return information from the given sample.
Instance Variable classes Undocumented
Instance Variable compute_metadata Undocumented
Property frame_labels_cls The fiftyone.core.labels.Label class(es) returned by this parser within the frame labels that it produces.
Property has_video_metadata Whether this parser produces fiftyone.core.metadata.VideoMetadata instances for samples that it parses.
Property label_cls The fiftyone.core.labels.Label class(es) returned by this parser within the sample-level labels that it produces.
Instance Variable _current_metadata Undocumented

Inherited from SampleParser (via LabeledVideoSampleParser):

Property current_sample The current sample.
Instance Variable _current_sample Undocumented
def __init__(self, classes=None, compute_metadata=False): (source)
def clear_sample(self): (source)

Clears the current sample.

Also clears any cached sample information stored by the parser.

def get_frame_labels(self): (source)

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
def get_label(self): (source)

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
def get_video_metadata(self): (source)

Returns the video metadata for the current sample.

Returns
a fiftyone.core.metadata.ImageMetadata instance
def get_video_path(self): (source)

Returns the video path for the current sample.

Returns
the path to the video on disk
def with_sample(self, sample, metadata=None): (source)

Sets the current sample so that subsequent calls to methods of this parser will return information from the given sample.

Guaranteed to call clear_sample before setting the current sample.

Parameters
samplea sample
metadataUndocumented

Undocumented

compute_metadata: False = (source)

Undocumented

@property
frame_labels_cls = (source)

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
@property
has_video_metadata = (source)

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
_current_metadata = (source)

Undocumented