class documentation

Dataset importer that ingests unlabeled images into the provided dataset_dir during import.

The source images are parsed from the provided samples using the provided fiftyone.utils.data.parsers.UnlabeledImageSampleParser.

If an image path is available via fiftyone.utils.data.parsers.UnlabeledImageSampleParser.get_image_path, then the image is directly copied from its source location into dataset_dir. In this case, the original filename is maintained, unless a name conflict would occur, in which case an index of the form "-%d" % count is appended to the base filename.

If no image path is available, the image is read in-memory via fiftyone.utils.data.parsers.UnlabeledImageSampleParser.get_image and written to dataset_dir in the following format:

<dataset_dir>/<image_count><image_format>

where image_count is the number of files in dataset_dir.

Parameters
dataset_dirthe directory where input images will be ingested into
samplesan iterable of samples that can be parsed by sample_parser
sample_parseran fiftyone.utils.data.parsers.UnlabeledImageSampleParser to use to parse the samples
image_formatthe image format to use when writing in-memory images to disk. By default, fiftyone.config.default_image_ext is used
max_samplesa maximum number of samples to import. By default, all samples are imported
Method __init__ Undocumented
Method __iter__ Undocumented
Method __len__ The total number of samples that will be imported.
Method __next__ Returns information about the next sample in the dataset.
Method setup Performs any necessary setup before importing the first sample in the dataset.
Instance Variable sample_parser Undocumented
Instance Variable samples Undocumented
Property has_dataset_info Whether this importer produces a dataset info dictionary.
Property has_image_metadata Whether this importer produces fiftyone.core.metadata.ImageMetadata instances for each image.
Instance Variable _iter_samples Undocumented
Instance Variable _num_imported Undocumented
Instance Variable _num_samples Undocumented

Inherited from DatasetImporter (via UnlabeledImageDatasetImporter):

Method __enter__ Undocumented
Method __exit__ Undocumented
Method close Performs any necessary actions after the last sample has been imported.
Method get_dataset_info Returns the dataset info for the dataset.
Method _preprocess_list 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 ImageIngestor (via UnlabeledImageDatasetImporter, DatasetImporter):

Method _ingest_image Undocumented
Method _ingest_image_from_path Undocumented
Method _ingest_in_memory_image Undocumented
Method _setup Undocumented
Instance Variable _filename_maker Undocumented
def __init__(self, dataset_dir, samples, sample_parser, image_format=None, max_samples=None): (source)
def __len__(self): (source)

The total number of samples that will be imported.

Raises
TypeErrorif the total number is not known
def __next__(self): (source)

Returns information about the next sample in the dataset.

Returns
an(image_path, image_metadata)
tuple
, where
Raises
StopIterationif there are no more samples to import
def setup(self): (source)

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__.

sample_parser = (source)

Undocumented

Undocumented

@property
has_dataset_info = (source)

Whether this importer produces a dataset info dictionary.

_iter_samples = (source)

Undocumented

_num_imported: int = (source)

Undocumented

_num_samples = (source)

Undocumented