class GeoJSONDatasetExporter(foud.GenericSampleDatasetExporter, foud.ExportPathsMixin): (source)
Constructor: GeoJSONDatasetExporter(export_dir, data_path, labels_path, export_media, ...)
Exporter for image or video datasets whose location data and labels are stored in GeoJSON format.
See :ref:`this page <GeoJSONDataset-export>` for format details.
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 images in the exported labels |
image | the image format to use when writing in-memory images to disk. By default, fiftyone.config.default_image_ext is used |
location | the name of the field containing the location data for each sample. Can be any of the following:
|
property | an optional dict mapping sample field names to functions that convert the field values to property values to be stored in the properties field of the GeoJSON Feature for the sample. By default, no properties are written |
omit | whether to omit None-valued Sample fields from the output properties |
pretty | whether 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 |
Exports the given sample to the dataset. |
Method | log |
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 |
Undocumented |
Instance Variable | data |
Undocumented |
Instance Variable | export |
Undocumented |
Instance Variable | image |
Undocumented |
Instance Variable | labels |
Undocumented |
Instance Variable | location |
Undocumented |
Instance Variable | omit |
Undocumented |
Instance Variable | pretty |
Undocumented |
Instance Variable | property |
Undocumented |
Instance Variable | rel |
Undocumented |
Instance Variable | _features |
Undocumented |
Instance Variable | _location |
Undocumented |
Instance Variable | _media |
Undocumented |
Inherited from DatasetExporter
(via GenericSampleDatasetExporter
):
Method | __enter__ |
Undocumented |
Method | __exit__ |
Undocumented |
Inherited from ExportPathsMixin
(via GenericSampleDatasetExporter
, 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__ |
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 | the
fiftyone.core.collections.SampleCollection whose
samples will be exported |
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__
.