JATICImageClassificationDataset

class nrtk.interop.maite.interop.image_classification.dataset.JATICImageClassificationDataset(imgs: Sequence[ndarray[Any, Any]], labels: Sequence[_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]], datum_metadata: Sequence[DatumMetadata], dataset_id: str, index2label: dict[int, str] | None = None)

Implementation of the JATIC Image Classification dataset wrapper for dataset images of varying sizes.

Parameters

imgsSequence[np.ndarray]

Sequence of images.

labelsSequence[ArrayLike]

Sequence of labels for each image.

datum_metadataSequence[DatumMetadataType]

Sequence of custom metadata for each image.

metadataDatasetMetadata

Metadata for 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], _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], DatumMetadata]

Returns the dataset object at the given index.

__init__(imgs: Sequence[ndarray[Any, Any]], labels: Sequence[_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]], datum_metadata: Sequence[DatumMetadata], 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. labels (Sequence[TargetType]): Sequence of labels 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).