ObjectDetectionImageDataset#
- class ObjectDetectionImageDataset[source]#
Bases:
ImageDataset
Read Object Detection data in the COCO format.
Uses
CocoDataset
to read the data.- __init__(img_dir: str, annotation_uri: str, *args, **kwargs)[source]#
Constructor.
- Parameters:
img_dir (str) – Directory containing the images. Image filenames must match the image IDs in the annotations file.
annotation_uri (str) – URI to a JSON file containing annotations in the COCO format.
*args – See
ImageDataset.__init__()
.**kwargs – See
ImageDataset.__init__()
.
Methods
__init__
(img_dir, annotation_uri, *args, ...)Constructor.
- __add__(other: Dataset[T_co]) ConcatDataset[T_co] #
- Parameters:
other (Dataset[T_co]) –
- Return type:
ConcatDataset[T_co]
- __getitem__(key) tuple[torch.Tensor, torch.Tensor] #
- Return type:
- __init__(img_dir: str, annotation_uri: str, *args, **kwargs)[source]#
Constructor.
- Parameters:
img_dir (str) – Directory containing the images. Image filenames must match the image IDs in the annotations file.
annotation_uri (str) – URI to a JSON file containing annotations in the COCO format.
*args – See
ImageDataset.__init__()
.**kwargs – See
ImageDataset.__init__()
.