class CSVDatasetExporter(foud.BatchDatasetExporter, foud.ExportPathsMixin): (source)
Constructor: CSVDatasetExporter(export_dir, data_path, labels_path, export_media, ...)
A flexible CSV exporter that represents slice(s) of field values of a dataset as columns of a CSV file.
See :ref:`this page <CSVDataset-export>` for exporting datasets of this type.
Parameters | |
export | the directory to write the export. This has no effect if data_path and labels_path are absolute paths |
data | an optional parameter that enables explicit control over the location of the exported media. Can be any of the following:
If None, the default value of this parameter will be chosen based on the value of the export_media parameter |
labels | an optional parameter that enables explicit control over the location of the exported labels. Can be any of the following:
If None, the labels will be exported into export_dir using the default filename |
export | controls how to export the raw media. The supported values are:
If None, the default value of this parameter will be chosen based on the value of the data_path parameter |
rel | an 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 data_path 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 |
abs | whether to store absolute paths to the media in the exported labels |
media | the name of the field containing the media to export for each sample |
fields | an optional argument specifying the fields or embedding.field.names to include as columns in the exported CSV. Can be:
By default, only the media_field is exported |
Method | __init__ |
Undocumented |
Method | close |
Performs any necessary actions after the last sample has been exported. |
Method | export |
Exports the given sample collection. |
Method | setup |
Performs any necessary setup before exporting the first sample in the dataset. |
Instance Variable | abs |
Undocumented |
Instance Variable | data |
Undocumented |
Instance Variable | export |
Undocumented |
Instance Variable | fields |
Undocumented |
Instance Variable | labels |
Undocumented |
Instance Variable | media |
Undocumented |
Instance Variable | rel |
Undocumented |
Instance Variable | _csv |
Undocumented |
Instance Variable | _f |
Undocumented |
Instance Variable | _include |
Undocumented |
Instance Variable | _media |
Undocumented |
Instance Variable | _media |
Undocumented |
Instance Variable | _needs |
Undocumented |
Instance Variable | _paths |
Undocumented |
Inherited from BatchDatasetExporter
:
Method | export |
Exports the given sample to the dataset. |
Inherited from DatasetExporter
(via BatchDatasetExporter
):
Method | __enter__ |
Undocumented |
Method | __exit__ |
Undocumented |
Method | log |
Logs any relevant information about the fiftyone.core.collections.SampleCollection whose samples will be exported. |
Inherited from ExportPathsMixin
(via BatchDatasetExporter
, DatasetExporter
):
Static Method | _parse |
Helper function that computes default values for the data_path and export_media parameters supported by many exporters. |
Static Method | _parse |
Helper function that computes default values for the labels_path parameter supported by many exporters. |
Undocumented
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 collection.
Parameters | |
sample | a
fiftyone.core.collections.SampleCollection |
progress:None | whether to render a progress bar (True/False), use the default value fiftyone.config.show_progress_bars (None), or a progress callback function to invoke instead |
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__
.