JATICObjectDetectionDataset

class nrtk.interop.maite.interop.object_detection.dataset.JATICObjectDetectionDataset(imgs: Sequence[np.ndarray], dets: Sequence[TargetType], datum_metadata: Sequence[DatumMetadataType], dataset_id: str, index2label: dict[int, str] | None = None)

Implementation of the JATIC Object Detection dataset wrapper for dataset images of varying sizes.

Parameters

imgsSequence[np.ndarray]

Sequence of images.

detsSequence[ObjectDetectionTarget]

Sequence of detections for each image.

datum_metadataSequence[DatumMetadataType]

Sequence of metadata for each image.

dataset_id: str

Dataset ID.

index2label: dict[int, str] | None

Mapping from class index to label.

Methods

__getitem__(index: int) tuple[ArrayLike, ObjectDetectionTarget, DatumMetadata]

Returns the dataset object at the given index.

__init__(imgs: Sequence[np.ndarray], dets: Sequence[TargetType], datum_metadata: Sequence[DatumMetadataType], dataset_id: str, index2label: dict[int, str] | None = None) None

Initialize MAITE-compliant dataset

Args:

imgs (Sequence[np.ndarray]): Sequence of images in the dataset. dets (Sequence[TargetType]): Sequence of detection targets for the images. datum_metadata (Sequence[DatumMetadataType]): Sequence of metadata dictionaries. dataset_id (str): Dataset ID. index2label (dict[int, str] | None): Mapping from class index to label.

__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).