class documentation

Importer for labeled video datasets whose labels are stored in ETA VideoLabels format.

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

Parameters
dataset_dirthe dataset directory
compute_metadatawhether to produce fiftyone.core.metadata.VideoMetadata instances for each video when importing
prefixa string prefix to prepend to each label name in the expanded sample/frame label dictionaries
labels_dicta 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_labels_dicta 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
multilabelwhether to store frame attributes in a single fiftyone.core.labels.Classifications instance
skip_non_categoricalwhether to skip non-categorical frame attributes (True) or cast them to strings (False)
shufflewhether to randomly shuffle the order in which the samples are imported
seeda random seed to use when shuffling
max_samplesa maximum number of samples to import. By default, all samples are imported
Method __init__ Undocumented
Method __iter__ Undocumented
Method __len__ The total number of samples that will be imported.
Method __next__ Returns information about the next sample in the dataset.
Method get_dataset_info Returns the dataset info for the dataset.
Method setup Performs any necessary setup before importing the first sample in the dataset.
Instance Variable compute_metadata Undocumented
Instance Variable frame_labels_dict Undocumented
Instance Variable labels_dict Undocumented
Instance Variable multilabel Undocumented
Instance Variable prefix Undocumented
Instance Variable skip_non_categorical Undocumented
Property frame_labels_cls The fiftyone.core.labels.Label class(es) returned by this importer within the frame labels that it produces.
Property has_dataset_info Whether this importer produces a dataset info dictionary.
Property has_video_metadata Whether this importer produces fiftyone.core.metadata.VideoMetadata instances for each video.
Property label_cls The fiftyone.core.labels.Label class(es) returned by this importer within the sample-level labels that it produces.
Static Method _get_num_samples Undocumented
Instance Variable _description Undocumented
Instance Variable _iter_samples Undocumented
Instance Variable _num_samples Undocumented
Instance Variable _sample_parser Undocumented
Instance Variable _samples Undocumented

Inherited from DatasetImporter (via LabeledVideoDatasetImporter):

Method __enter__ Undocumented
Method __exit__ Undocumented
Method close Performs any necessary actions after the last sample has been imported.
Method _preprocess_list Internal utility that preprocesses the given list---which is presumed to be a list defining the samples that should be imported---by applying the values of the shuffle, seed, and max_samples parameters of the importer.
def __init__(self, dataset_dir, compute_metadata=False, prefix=None, labels_dict=None, frame_labels_dict=None, multilabel=False, skip_non_categorical=False, shuffle=False, seed=None, max_samples=None): (source)
def __len__(self): (source)

The total number of samples that will be imported.

Raises
TypeErrorif the total number is not known
def __next__(self): (source)

Returns information about the next sample in the dataset.

Returns
an(video_path, video_metadata, labels, frames)
tuple
, where
Raises
StopIterationif there are no more samples to import
def get_dataset_info(self): (source)

Returns the dataset info for the dataset.

By convention, this method should be called after all samples in the dataset have been imported.

Returns
a dict of dataset info
def setup(self): (source)

Performs any necessary setup before importing the first sample in the dataset.

This method is called when the importer's context manager interface is entered, DatasetImporter.__enter__.

compute_metadata: False = (source)

Undocumented

frame_labels_dict: None = (source)

Undocumented

labels_dict: None = (source)

Undocumented

multilabel: False = (source)

Undocumented

Undocumented

skip_non_categorical: False = (source)

Undocumented

@property
frame_labels_cls = (source)

The fiftyone.core.labels.Label class(es) returned by this importer within the frame labels that it produces.

This can be any of the following:

  • a fiftyone.core.labels.Label class. In this case, the importer is guaranteed to return frame labels of this type
  • a list or tuple of fiftyone.core.labels.Label classes. In this case, the importer 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 importer 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 importer makes no guarantees about the frame labels that it may return
@property
has_dataset_info = (source)

Whether this importer produces a dataset info dictionary.

The fiftyone.core.labels.Label class(es) returned by this importer 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 importer is guaranteed to return sample-level labels of this type
  • a list or tuple of fiftyone.core.labels.Label classes. In this case, the importer 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 importer 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 importer makes no guarantees about the sample-level labels that it may return
@staticmethod
def _get_num_samples(dataset_dir): (source)

Undocumented

_description = (source)

Undocumented

_iter_samples = (source)

Undocumented

_num_samples = (source)

Undocumented

_sample_parser = (source)

Undocumented

_samples = (source)

Undocumented