class documentation

Legacy exporter that writes an entire FiftyOne dataset to disk in a serialized JSON format along with its source media.

Warning

The fiftyone.types.FiftyOneDataset format was upgraded in fiftyone==0.8 and this exporter is now deprecated. The new exporter is FiftyOneDatasetExporter.

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
  • False: don't export media
  • "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 media. When exporting media, 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
chunk_sizean optional chunk size to use when exporting media files. If provided, media files will be nested in subdirectories of the output directory with at most this many media files per subdirectory. Has no effect if a rel_dir is provided
abs_pathswhether to store absolute paths to the media in the exported labels
export_saved_viewswhether to include saved views in the export. Only applicable when exporting full datasets
export_runswhether to include annotation/brain/evaluation runs in the export. Only applicable when exporting full datasets
export_workspaceswhether to include saved workspaces in the export. Only applicable when exporting full datasets
pretty_printwhether to render the JSON in human readable format with newlines and indentations
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 abs_paths Undocumented
Instance Variable chunk_size Undocumented
Instance Variable export_media Undocumented
Instance Variable export_runs Undocumented
Instance Variable export_saved_views Undocumented
Instance Variable export_workspaces Undocumented
Instance Variable pretty_print Undocumented
Instance Variable rel_dir Undocumented
Method _export_frame_labels Undocumented
Method _export_media_field Undocumented
Method _export_media_fields Undocumented
Method _get_media_field_exporter Undocumented
Instance Variable _anno_dir Undocumented
Instance Variable _brain_dir Undocumented
Instance Variable _data_dir Undocumented
Instance Variable _eval_dir Undocumented
Instance Variable _fields_dir Undocumented
Instance Variable _frame_labels_dir Undocumented
Instance Variable _media_exporter Undocumented
Instance Variable _media_field_exporters Undocumented
Instance Variable _media_fields Undocumented
Instance Variable _metadata Undocumented
Instance Variable _metadata_path Undocumented
Instance Variable _runs_dir Undocumented
Instance Variable _samples Undocumented
Instance Variable _samples_path Undocumented

Inherited from DatasetExporter (via GenericSampleDatasetExporter):

Method __enter__ Undocumented
Method __exit__ Undocumented
def __init__(self, export_dir, export_media=None, rel_dir=None, chunk_size=None, abs_paths=False, export_saved_views=True, export_runs=True, export_workspaces=True, pretty_print=False): (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, sample): (source)

Exports the given sample to the dataset.

Parameters
samplea fiftyone.core.sample.Sample
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__.

abs_paths: False = (source)

Undocumented

chunk_size: None = (source)

Undocumented

export_media: None = (source)

Undocumented

export_runs: True = (source)

Undocumented

export_saved_views: True = (source)

Undocumented

export_workspaces: True = (source)

Undocumented

pretty_print: False = (source)

Undocumented

Undocumented

def _export_frame_labels(self, sample, uuid): (source)

Undocumented

def _export_media_field(self, d, field_name, key=None): (source)

Undocumented

def _export_media_fields(self, sd): (source)

Undocumented

def _get_media_field_exporter(self, field_name): (source)

Undocumented

_anno_dir = (source)

Undocumented

_brain_dir = (source)

Undocumented

_data_dir = (source)

Undocumented

_eval_dir = (source)

Undocumented

_fields_dir = (source)

Undocumented

_frame_labels_dir = (source)

Undocumented

_media_exporter = (source)

Undocumented

_media_field_exporters: dict = (source)

Undocumented

_media_fields = (source)

Undocumented

_metadata: dict = (source)

Undocumented

_metadata_path = (source)

Undocumented

_runs_dir = (source)

Undocumented

_samples: list = (source)

Undocumented

_samples_path = (source)

Undocumented