COCOJATICObjectDetectionDataset

class xaitk_jatic.interop.object_detection.dataset.COCOJATICObjectDetectionDataset(kwcoco_dataset: kwcoco.CocoDataset, image_metadata: Sequence[DatumMetadataType], skip_no_anns: bool = False, dataset_id: str | None = None)

Dataset class to convert a COCO dataset to a dataset compliant with JATIC’s Object Detection protocol.

Parameters

metadata: DatasetMetadata

Metadata of this dataset.

Methods

__getitem__(index: int) tuple[_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], ObjectDetectionTarget, COCOMetadata]

Returns the dataset object at the given index.

__init__(kwcoco_dataset: kwcoco.CocoDataset, image_metadata: Sequence[DatumMetadataType], skip_no_anns: bool = False, dataset_id: str | None = None) None

Initialize MAITE-compliant dataset from a COCO dataset.

Args:

kwcoco_dataset (kwcoco.CocoDataset): The COCO dataset object. image_metadata (Sequence[DatumMetadataType]): Metadata for each image. skip_no_anns (bool): Whether to skip images without annotations. Defaults to False. dataset_id (str): Dataset ID, defaults to filepath.

Raises:

ImportError: If required dependencies are not installed. ValueError: If metadata is missing for any image in the dataset.

__len__() int

Returns the number of images in the dataset.

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).