class documentation

Interface for exporting datasets of labeled video samples.

See :ref:`this page <writing-a-custom-dataset-exporter>` for information about implementing/using dataset exporters.

Parameters
export_dirthe directory to write the export. This may be optional for some exporters
Method export_sample Exports the given sample to the dataset.
Property frame_labels_cls The fiftyone.core.labels.Label class(es) that can be exported by this exporter at the frame-level.
Property label_cls The fiftyone.core.labels.Label class(es) that can be exported at the sample-level.
Property requires_video_metadata Whether this exporter requires fiftyone.core.metadata.VideoMetadata instances for each sample being exported.

Inherited from DatasetExporter:

Method __enter__ Undocumented
Method __exit__ Undocumented
Method __init__ Undocumented
Method close Performs any necessary actions after the last sample has been exported.
Method log_collection Logs any relevant information about the fiftyone.core.collections.SampleCollection whose samples will be exported.
Method setup Performs any necessary setup before exporting the first sample in the dataset.
def export_sample(self, video_path, label, frames, metadata=None): (source)

Exports the given sample to the dataset.

Parameters
video_paththe path to a video on disk
labelan instance of label_cls, or a dictionary mapping field names to fiftyone.core.labels.Label instances, or None if the sample has no sample-level labels
framesa dictionary mapping frame numbers to dictionaries that map field names to fiftyone.core.labels.Label instances, or None if the sample has no frame-level labels
metadata:Nonea fiftyone.core.metadata.VideoMetadata instance for the sample. Only required when requires_video_metadata is True
@property
frame_labels_cls = (source)

The fiftyone.core.labels.Label class(es) that can be exported by this exporter at the frame-level.

This can be any of the following:

  • a fiftyone.core.labels.Label class. In this case, the exporter directly exports frame labels of this type
  • a list or tuple of fiftyone.core.labels.Label classes. In this case, the exporter can export a single frame label field of any of these types
  • a dict mapping keys to fiftyone.core.labels.Label classes. In this case, the exporter can export multiple frame label fields with value-types specified by this dictionary. Not all keys need be present in the exported frame labels
  • None. In this case, the exporter makes no guarantees about the frame labels that it can export

The fiftyone.core.labels.Label class(es) that can be exported at the sample-level.

This can be any of the following:

  • a fiftyone.core.labels.Label class. In this case, the exporter directly exports sample-level labels of this type
  • a list or tuple of fiftyone.core.labels.Label classes. In this case, the exporter can export 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 exporter can export multiple label fields with value-types specified by this dictionary. Not all keys need be present in the exported sample-level labels
  • None. In this case, the exporter makes no guarantees about the sample-level labels that it can export