class GenericSampleDatasetImporter(DatasetImporter): (source)
Known subclasses: fiftyone.utils.csv.CSVDatasetImporter
, fiftyone.utils.data.importers.GroupDatasetImporter
, fiftyone.utils.data.importers.LegacyFiftyOneDatasetImporter
, fiftyone.utils.geojson.GeoJSONDatasetImporter
Constructor: GenericSampleDatasetImporter(dataset_dir, shuffle, seed, max_samples)
Interface for importing datasets that contain arbitrary
fiftyone.core.sample.Sample
instances.
Typically, dataset importers should implement the parameters documented on this class, although this is not mandatory.
See :ref:`this page <writing-a-custom-dataset-importer>` for information about implementing/using dataset importers.
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 | get |
Returns a dictionary describing the field schema of the samples loaded by this importer. |
Property | has |
Whether this importer produces a sample field schema. |
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. |
Property | has |
Whether this importer produces a dataset info dictionary. |
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. |
fiftyone.utils.csv.CSVDatasetImporter
, fiftyone.utils.data.importers.GroupDatasetImporter
, fiftyone.utils.data.importers.LegacyFiftyOneDatasetImporter
, fiftyone.utils.geojson.GeoJSONDatasetImporter
Returns information about the next sample in the dataset.
Returns | |
a fiftyone.core.sample.Sample instance | |
Raises | |
StopIteration | if there are no more samples to import |
Returns a dictionary describing the field schema of the samples loaded by this importer.
Returns | |
a dict mapping field names to fiftyone.core.fields.Field
instances or str(field) representations of them |
fiftyone.utils.csv.CSVDatasetImporter
, fiftyone.utils.data.importers.LegacyFiftyOneDatasetImporter
, fiftyone.utils.geojson.GeoJSONDatasetImporter
Whether this importer produces a sample field schema.