class TFRecordsLabeledImageDatasetImporter(foud.LabeledImageDatasetImporter, foud.ImportPathsMixin): (source)
Known subclasses: fiftyone.utils.tf.TFImageClassificationDatasetImporter
, fiftyone.utils.tf.TFObjectDetectionDatasetImporter
Constructor: TFRecordsLabeledImageDatasetImporter(dataset_dir, tf_records_path, images_dir, image_format, ...)
Base class for
fiftyone.utils.data.importers.LabeledImageDatasetImporter
instances that import tf.train.Example protos containing labeled
images.
This class assumes that the input TFRecords only contain the images themselves and not their paths on disk, and, therefore, the images are read in-memory and written to the provided images_dir during import.
Parameters | |
dataset | the dataset directory. If omitted, tf_records_path must be provided |
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 *record* |
images | the directory in which the images will be written. If not provided, the images will be unpacked into dataset_dir |
image | the image format to use to write the images to disk. By default, fiftyone.config.default_image_ext is used |
force | whether to force convert all images to RGB |
max | a maximum number of samples to import. By default, all samples are imported |
Method | __init__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | __next__ |
Returns information about the next sample in the dataset. |
Method | close |
Performs any necessary actions after the last sample has been imported. |
Method | setup |
Performs any necessary setup before importing the first sample in the dataset. |
Instance Variable | force |
Undocumented |
Instance Variable | image |
Undocumented |
Instance Variable | images |
Undocumented |
Instance Variable | tf |
Undocumented |
Property | has |
Whether this importer produces a dataset info dictionary. |
Property | has |
Whether this importer produces fiftyone.core.metadata.ImageMetadata instances for each image. |
Method | _make |
Returns a TFRecordSampleParser instance for parsing TFRecords read by this importer. |
Instance Variable | _dataset |
Undocumented |
Instance Variable | _iter |
Undocumented |
Instance Variable | _sample |
Undocumented |
Inherited from LabeledImageDatasetImporter
:
Property | label |
The fiftyone.core.labels.Label class(es) returned by this importer. |
Inherited from DatasetImporter
(via LabeledImageDatasetImporter
):
Method | __enter__ |
Undocumented |
Method | __exit__ |
Undocumented |
Method | __len__ |
The total number of samples that will be imported. |
Method | get |
Returns the dataset info for the dataset. |
Method | _preprocess |
Internal utility that preprocesses the given list---which is presumed to be a list defining the samples that should be imported---by applying the values of the shuffle, seed, and max_samples parameters of the importer. |
Inherited from ImportPathsMixin
(via LabeledImageDatasetImporter
, DatasetImporter
):
Static Method | _load |
Helper function that parses either a data directory or a data manifest file into a UUID -> filepath map. |
Static Method | _parse |
Helper function that computes default values for the data_path parameter supported by many importers. |
Static Method | _parse |
Helper function that computes default values for the labels_path parameter supported by many importers. |
Undocumented
Returns information about the next sample in the dataset.
Returns | |
an(image_path, image_metadata, label)tuple, where |
|
Raises | |
StopIteration | if there are no more samples to import |
Performs any necessary actions after the last sample has been imported.
This method is called when the importer's context manager interface is
exited, DatasetImporter.__exit__
.
Parameters | |
*args | the arguments to DatasetImporter.__exit__ |
Performs any necessary setup before importing the first sample in the dataset.
This method is called when the importer's context manager interface is
entered, DatasetImporter.__enter__
.
fiftyone.utils.tf.TFImageClassificationDatasetImporter
, fiftyone.utils.tf.TFObjectDetectionDatasetImporter
Undocumented
fiftyone.utils.tf.TFImageClassificationDatasetImporter
, fiftyone.utils.tf.TFObjectDetectionDatasetImporter
Undocumented
fiftyone.utils.tf.TFImageClassificationDatasetImporter
, fiftyone.utils.tf.TFObjectDetectionDatasetImporter
Undocumented
fiftyone.utils.tf.TFImageClassificationDatasetImporter
, fiftyone.utils.tf.TFObjectDetectionDatasetImporter
Undocumented
fiftyone.utils.tf.TFImageClassificationDatasetImporter
, fiftyone.utils.tf.TFObjectDetectionDatasetImporter
Returns a TFRecordSampleParser
instance for parsing
TFRecords read by this importer.