COCOJATICObjectDetectionDataset
- class nrtk.interop.maite.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
Returns the list of categories for this dataset.
Returns the sorted list of absolute paths for the input images.
Checks if the required kwcoco module is available.
- __getitem__(index: int) tuple[ArrayLike, 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).
- get_categories() list[dict[str, Any]]
Returns the list of categories for this dataset.
- get_img_path_list() list[Path]
Returns the sorted list of absolute paths for the input images.
- classmethod is_usable() bool
Checks if the required kwcoco module is available.
- Returns:
bool: True if kwcoco is installed; False otherwise.