JATICImageClassificationDataset
- class nrtk.interop.maite.interop.image_classification.dataset.JATICImageClassificationDataset(imgs: Sequence[ndarray], labels: Sequence[ArrayLike], 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[ArrayLike, ArrayLike, DatumMetadata]
Returns the dataset object at the given index.
- __init__(imgs: Sequence[ndarray], labels: Sequence[ArrayLike], 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 (Optional[dict[int, str]]): 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).