«
class documentation

Base interface for exporting datasets.

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 __enter__ Undocumented
Method __exit__ Undocumented
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 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.
Instance Variable export_dir Undocumented
def __enter__(self): (source)

Undocumented

def __exit__(self, *args): (source)

Undocumented

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 log_collection(self, sample_collection): (source)

Logs any relevant information about the fiftyone.core.collections.SampleCollection whose samples will be exported.

Subclasses can optionally implement this method if their export format can record information such as the fiftyone.core.collections.SampleCollection.info of the collection being exported.

By convention, this method must be optional; i.e., if it is not called before the first call to export_sample, then the exporter must make do without any information about the fiftyone.core.collections.SampleCollection (which may not be available, for example, if the samples being exported are not stored in a collection).

Parameters
sample_collectionthe fiftyone.core.collections.SampleCollection whose samples will be exported
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__.