class MediaDirectoryExporter(UnlabeledMediaDatasetExporter): (source)
Constructor: MediaDirectoryExporter(export_dir, export_media, rel_dir)
Exporter that writes a directory of media files of arbitrary type to disk.
See :ref:`this page <MediaDirectory-export>` for format details.
The filenames of the input media files 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 | the directory to write the export |
export | defines how to export the raw media contained in the dataset. The supported values are:
|
rel | an optional relative directory to strip from each input
filepath to generate a unique identifier for each output file. This
identifier is joined with export_dir to generate an output path
for each exported media. 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 |
Exports the given sample to the dataset. |
Method | setup |
Performs any necessary setup before exporting the first sample in the dataset. |
Instance Variable | export |
Undocumented |
Instance Variable | rel |
Undocumented |
Property | requires |
Whether this exporter requires fiftyone.core.metadata.Metadata instances for each sample being exported. |
Instance Variable | _media |
Undocumented |
Inherited from DatasetExporter
(via UnlabeledMediaDatasetExporter
):
Method | __enter__ |
Undocumented |
Method | __exit__ |
Undocumented |
Method | log |
Logs any relevant information about the fiftyone.core.collections.SampleCollection whose samples will be exported. |
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 | |
*args | the arguments to DatasetExporter.__exit__ |
Exports the given sample to the dataset.
Parameters | |
filepath | a media path |
metadata:None | a fiftyone.core.metadata.Metadata
instance for the sample. Only required when
requires_metadata is True |
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__
.
Whether this exporter requires
fiftyone.core.metadata.Metadata
instances for each sample
being exported.