class TFRecordsDatasetExporter(foud.LabeledImageDatasetExporter, foud.ExportPathsMixin): (source)
Known subclasses: fiftyone.utils.tf.TFImageClassificationDatasetExporter
, fiftyone.utils.tf.TFObjectDetectionDatasetExporter
Constructor: TFRecordsDatasetExporter(export_dir, tf_records_path, num_shards, image_format, force_rgb)
Base class for
fiftyone.utils.data.exporters.LabeledImageDatasetExporter
instances that export labeled images as TFRecords datasets on disk.
Parameters | |
export | the directory to write the export. This has no effect if tf_records_path is an absolute path |
tf | an optional parameter that enables explicit control over the location of the TF records. Can be any of the following:
If None, the parameter will default to tf.records |
num | an optional number of shards to split the records into (using a round robin strategy). If specified, -%%05d-of-%%05d is appended to the records path |
image | the image format to use when writing in-memory images to disk. By default, fiftyone.config.default_image_ext is used |
force | whether to force convert all images to RGB |
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 | force |
Undocumented |
Instance Variable | image |
Undocumented |
Instance Variable | num |
Undocumented |
Instance Variable | tf |
Undocumented |
Property | requires |
Whether this exporter requires fiftyone.core.metadata.ImageMetadata instances for each sample being exported. |
Method | _make |
Returns a TFExampleGenerator instance that will generate tf.train.Example protos for this exporter. |
Instance Variable | _example |
Undocumented |
Instance Variable | _filename |
Undocumented |
Instance Variable | _tf |
Undocumented |
Inherited from LabeledImageDatasetExporter
:
Property | label |
The fiftyone.core.labels.Label class(es) exported by this exporter. |
Inherited from DatasetExporter
(via LabeledImageDatasetExporter
):
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 LabeledImageDatasetExporter
, 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. |
fiftyone.utils.tf.TFObjectDetectionDatasetExporter
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 to the dataset.
Parameters | |
image | an image or the path to the image on disk |
label | an instance of label_cls , or a dictionary mapping
field names to fiftyone.core.labels.Label instances,
or None if the sample is unlabeled |
metadata:None | a fiftyone.core.metadata.ImageMetadata
instance for the sample. Only required when
requires_image_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__
.
fiftyone.utils.tf.TFImageClassificationDatasetExporter
, fiftyone.utils.tf.TFObjectDetectionDatasetExporter
Undocumented
fiftyone.utils.tf.TFImageClassificationDatasetExporter
, fiftyone.utils.tf.TFObjectDetectionDatasetExporter
Undocumented
fiftyone.utils.tf.TFImageClassificationDatasetExporter
, fiftyone.utils.tf.TFObjectDetectionDatasetExporter
Undocumented
fiftyone.utils.tf.TFImageClassificationDatasetExporter
, fiftyone.utils.tf.TFObjectDetectionDatasetExporter
Undocumented
Whether this exporter requires
fiftyone.core.metadata.ImageMetadata
instances for each sample
being exported.
fiftyone.utils.tf.TFImageClassificationDatasetExporter
, fiftyone.utils.tf.TFObjectDetectionDatasetExporter
Returns a TFExampleGenerator
instance that will generate
tf.train.Example protos for this exporter.