class OpenImagesDatasetImporter(foud.LabeledImageDatasetImporter): (source)
Known subclasses: fiftyone.utils.openimages.OpenImagesV6DatasetImporter
, fiftyone.utils.openimages.OpenImagesV7DatasetImporter
Constructor: OpenImagesDatasetImporter(dataset_dir, label_types, classes, attrs, ...)
Base class for importing datasets in Open Images format.
See fiftyone.types.OpenImagesDataset
for format details.
Parameters | |
dataset | the dataset directory |
label | a label type or list of label types to load. The supported values are ("detections", "classifications", "points", "relationships", "segmentations"). "points" are only supported for open-images-v7. By default, all supported label types for version are loaded |
classes | a string or list of strings specifying required classes to load. If provided, only samples containing at least one instance of a specified class will be loaded |
attrs | a string or list of strings specifying required relationship attributes to load. Only applicable when label_types includes "relationships". If provided, only samples containing at least one instance of a specified attribute will be loaded |
image | an optional list of specific image IDs to load. Can be provided in any of the following formats:
|
include | whether to load the Open Images ID for each sample along with the labels |
only | whether to only load labels that match the classes or attrs requirements that you provide (True), or to load all labels for samples that match the requirements (False) |
load | whether to load the classes hierarchy and add it to the dataset's info dictionary |
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 load. If label_types, classes, and/or attrs are also specified, first priority will be given to samples that contain all of the specified label types, classes, and/or attributes, followed by samples that contain at least one of the specified labels types or classes. The actual number of samples loaded may be less than this maximum value if the dataset does not contain sufficient samples matching your requirements. By default, all matching samples are loaded |
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 | get |
Returns the dataset info for the dataset. |
Method | setup |
Performs any necessary setup before importing the first sample in the dataset. |
Instance Variable | attrs |
Undocumented |
Instance Variable | classes |
Undocumented |
Instance Variable | image |
Undocumented |
Instance Variable | label |
Undocumented |
Instance Variable | load |
Undocumented |
Instance Variable | only |
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. |
Property | label |
The fiftyone.core.labels.Label class(es) returned by this importer. |
Instance Variable | _attrs |
Undocumented |
Instance Variable | _classes |
Undocumented |
Instance Variable | _cls |
Undocumented |
Instance Variable | _det |
Undocumented |
Instance Variable | _images |
Undocumented |
Instance Variable | _info |
Undocumented |
Instance Variable | _iter |
Undocumented |
Instance Variable | _pnt |
Undocumented |
Instance Variable | _point |
Undocumented |
Instance Variable | _rel |
Undocumented |
Instance Variable | _seg |
Undocumented |
Instance Variable | _uuids |
Undocumented |
Property | _has |
Undocumented |
Inherited from DatasetImporter
(via LabeledImageDatasetImporter
):
Method | __enter__ |
Undocumented |
Method | __exit__ |
Undocumented |
Method | close |
Performs any necessary actions after the last sample has been imported. |
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 | |
an(image_path, image_metadata, label)tuple, where |
|
Raises | |
StopIteration | if there are no more samples to import |
Returns the dataset info for the dataset.
By convention, this method should be called after all samples in the dataset have been imported.
Returns | |
a dict of dataset info |
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.openimages.OpenImagesV6DatasetImporter
, fiftyone.utils.openimages.OpenImagesV7DatasetImporter
Undocumented
fiftyone.utils.openimages.OpenImagesV6DatasetImporter
, fiftyone.utils.openimages.OpenImagesV7DatasetImporter
Undocumented
fiftyone.utils.openimages.OpenImagesV6DatasetImporter
, fiftyone.utils.openimages.OpenImagesV7DatasetImporter
Undocumented
fiftyone.utils.openimages.OpenImagesV6DatasetImporter
, fiftyone.utils.openimages.OpenImagesV7DatasetImporter
Undocumented
fiftyone.utils.openimages.OpenImagesV6DatasetImporter
, fiftyone.utils.openimages.OpenImagesV7DatasetImporter
Undocumented
fiftyone.utils.openimages.OpenImagesV6DatasetImporter
, fiftyone.utils.openimages.OpenImagesV7DatasetImporter
Undocumented
The fiftyone.core.labels.Label
class(es) returned by this
importer.
This can be any of the following:
- a
fiftyone.core.labels.Label
class. In this case, the importer is guaranteed to return labels of this type - a list or tuple of
fiftyone.core.labels.Label
classes. In this case, the importer can produce a single label field of any of these types - a dict mapping keys to
fiftyone.core.labels.Label
classes. In this case, the importer will return label dictionaries with keys and value-types specified by this dictionary. Not all keys need be present in the imported labels - None. In this case, the importer makes no guarantees about the labels that it may return