class documentation
class BatchDatasetImporter(DatasetImporter): (source)
Known subclasses: fiftyone.utils.data.importers.FiftyOneDatasetImporter
, fiftyone.utils.fiw.FIWDatasetImporter
Constructor: BatchDatasetImporter(dataset_dir, shuffle, seed, max_samples)
Base interface for importers that load all of their samples in a single
call to import_samples
.
This interface allows for greater efficiency for import formats that handle aggregating over the samples themselves.
Typically, dataset importers should implement the parameters documented on this class, although this is not mandatory.
Parameters | |
dataset | the dataset directory. This may be optional for some importers |
shuffle | whether to randomly shuffle the order in which the samples are imported |
seed | a random seed to use when shuffling |
max | a maximum number of samples to import. By default, all samples are imported |
Method | __next__ |
Returns information about the next sample in the dataset. |
Method | import |
Imports the samples into the given dataset. |
Property | has |
Whether this importer produces a dataset info dictionary. |
Inherited from DatasetImporter
:
Method | __enter__ |
Undocumented |
Method | __exit__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | __len__ |
The total number of samples that will be imported. |
Method | close |
Performs any necessary actions after the last sample has been imported. |
Method | get |
Returns the dataset info for the dataset. |
Method | setup |
Performs any necessary setup before importing the first sample in 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. |
Returns information about the next sample in the dataset.
Returns | |
subclass-specific information for the sample | |
Raises | |
StopIteration | if there are no more samples to import |
overridden in
fiftyone.utils.data.importers.FiftyOneDatasetImporter
, fiftyone.utils.fiw.FIWDatasetImporter
Imports the samples into the given dataset.
Parameters | |
dataset | a fiftyone.core.dataset.Dataset |
tags:None | an optional list of tags to attach to each sample |
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 |
Returns | |
a list of IDs of the samples that were added to the dataset |