datumaro.plugins.data_formats.open_images#

Classes

OpenImagesBase(path, *[, image_meta, ctx])

OpenImagesExporter(extractor, save_dir, *[, ...])

OpenImagesImporter()

OpenImagesPath()

Exceptions

UnsupportedBoxIdError(item_id, box_id)

Method generated by attrs for class UnsupportedBoxIdError.

UnsupportedMaskPathError(item_id, mask_path)

Method generated by attrs for class UnsupportedMaskPathError.

UnsupportedSubsetNameError(item_id, subset)

Method generated by attrs for class UnsupportedSubsetNameError.

exception datumaro.plugins.data_formats.open_images.UnsupportedSubsetNameError(item_id: str, subset: str)[source]#

Bases: DatasetError

Method generated by attrs for class UnsupportedSubsetNameError.

item_id: str#
subset: str#
exception datumaro.plugins.data_formats.open_images.UnsupportedBoxIdError(item_id: str, box_id: str)[source]#

Bases: DatasetError

Method generated by attrs for class UnsupportedBoxIdError.

item_id: str#
box_id: str#
exception datumaro.plugins.data_formats.open_images.UnsupportedMaskPathError(item_id: str, mask_path: str)[source]#

Bases: DatasetError

Method generated by attrs for class UnsupportedMaskPathError.

item_id: str#
mask_path: str#
class datumaro.plugins.data_formats.open_images.OpenImagesPath[source]#

Bases: object

ANNOTATIONS_DIR = 'annotations'#
IMAGES_DIR = 'images'#
MASKS_DIR = 'masks'#
FULL_IMAGE_DESCRIPTION_FILE_NAME = 'image_ids_and_rotation.csv'#
SUBSET_IMAGE_DESCRIPTION_FILE_PATTERNS = ('*-images-with-rotation.csv', '*-images-with-labels-with-rotation.csv')#
V5_CLASS_DESCRIPTION_FILE_NAME = 'class-descriptions.csv'#
V5_CLASS_DESCRIPTION_BBOX_FILE_NAME = 'class-descriptions-boxable.csv'#
HIERARCHY_FILE_NAME = 'bbox_labels_600_hierarchy.json'#
LABEL_DESCRIPTION_FILE_SUFFIX = '-annotations-human-imagelabels.csv'#
BBOX_DESCRIPTION_FILE_SUFFIX = '-annotations-bbox.csv'#
MASK_DESCRIPTION_FILE_SUFFIX = '-annotations-object-segmentation.csv'#
IMAGE_DESCRIPTION_FIELDS = ('ImageID', 'Subset', 'OriginalURL', 'OriginalLandingURL', 'License', 'AuthorProfileURL', 'Author', 'Title', 'OriginalSize', 'OriginalMD5', 'Thumbnail300KURL', 'Rotation')#
LABEL_DESCRIPTION_FIELDS = ('ImageID', 'Source', 'LabelName', 'Confidence')#
BBOX_DESCRIPTION_FIELDS = ('ImageID', 'Source', 'LabelName', 'Confidence', 'XMin', 'XMax', 'YMin', 'YMax', 'IsOccluded', 'IsTruncated', 'IsGroupOf', 'IsDepiction', 'IsInside')#
BBOX_BOOLEAN_ATTRIBUTES = (namespace(datumaro_name='occluded', oid_name='IsOccluded'), namespace(datumaro_name='truncated', oid_name='IsTruncated'), namespace(datumaro_name='is_group_of', oid_name='IsGroupOf'), namespace(datumaro_name='is_depiction', oid_name='IsDepiction'), namespace(datumaro_name='is_inside', oid_name='IsInside'))#
MASK_DESCRIPTION_FIELDS = ('MaskPath', 'ImageID', 'LabelName', 'BoxID', 'BoxXMin', 'BoxXMax', 'BoxYMin', 'BoxYMax', 'PredictedIoU', 'Clicks')#
class datumaro.plugins.data_formats.open_images.OpenImagesBase(path: str, *, image_meta: dict | str | None = None, ctx: ImportContext | None = None)[source]#

Bases: DatasetBase

categories()[source]#

Returns metainfo about dataset labels.

class datumaro.plugins.data_formats.open_images.OpenImagesImporter[source]#

Bases: Importer

POSSIBLE_ANNOTATION_PATTERNS = ('image_ids_and_rotation.csv', '*-images-with-rotation.csv', '*-images-with-labels-with-rotation.csv', '*-annotations-human-imagelabels.csv', '*-annotations-bbox.csv', '*-annotations-object-segmentation.csv')#
classmethod detect(context: FormatDetectionContext) None[source]#
classmethod find_sources(path)[source]#
classmethod get_file_extensions() List[str][source]#
class datumaro.plugins.data_formats.open_images.OpenImagesExporter(extractor: IDataset, save_dir: str, *, save_media: bool | None = None, image_ext: str | None = None, default_image_ext: str | None = None, save_dataset_meta: bool = False, save_hashkey_meta: bool = False, stream: bool = False, ctx: ExportContext | None = None)[source]#

Bases: Exporter

DEFAULT_IMAGE_EXT = '.jpg'#
classmethod patch(dataset, patch, save_dir, **options)[source]#