class documentation

Exporter that writes a directory of videos to disk.

See :ref:`this page <VideoDirectory-export>` for format details.

The filenames of the input videos will be maintained in the export directory, unless a name conflict would occur, in which case an index of the form "-%d" % count is appended to the base filename.

Parameters
export_dirthe directory to write the export
export_media

defines how to export the raw media contained in the dataset. The supported values are:

  • True (default): copy all media files into the export directory
  • "move": move media files into the export directory
  • "symlink": create symlinks to each media file in the export directory
rel_diran optional relative directory to strip from each input filepath to generate a unique identifier for each video. When exporting media, this identifier is joined with export_dir to generate an output path for each exported video. This argument allows for populating nested subdirectories that match the shape of the input paths. The path is converted to an absolute path (if necessary) via fiftyone.core.storage.normalize_path
Method __init__ Undocumented
Method close Performs any necessary actions after the last sample has been exported.
Method export_sample Exports the given sample to the dataset.
Method setup Performs any necessary setup before exporting the first sample in the dataset.
Instance Variable export_media Undocumented
Instance Variable rel_dir Undocumented
Property requires_video_metadata Whether this exporter requires fiftyone.core.metadata.VideoMetadata instances for each sample being exported.
Instance Variable _media_exporter Undocumented

Inherited from DatasetExporter (via UnlabeledVideoDatasetExporter):

Method __enter__ Undocumented
Method __exit__ Undocumented
Method log_collection Logs any relevant information about the fiftyone.core.collections.SampleCollection whose samples will be exported.
def __init__(self, export_dir, export_media=None, rel_dir=None): (source)
def close(self, *args): (source)

Performs any necessary actions after the last sample has been exported.

This method is called when the exporter's context manager interface is exited, DatasetExporter.__exit__.

Parameters
*argsthe arguments to DatasetExporter.__exit__
def export_sample(self, video_path, metadata=None): (source)

Exports the given sample to the dataset.

Parameters
video_paththe path to a video on disk
metadata:Nonea fiftyone.core.metadata.VideoMetadata instance for the sample. Only required when requires_video_metadata is True
def setup(self): (source)

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

This method is called when the exporter's context manager interface is entered, DatasetExporter.__enter__.

export_media: None = (source)

Undocumented

Undocumented

@property
requires_video_metadata = (source)

Whether this exporter requires fiftyone.core.metadata.VideoMetadata instances for each sample being exported.

_media_exporter = (source)

Undocumented