CocoDetection — Torchvision 0.22 documentation (original) (raw)

class torchvision.datasets.CocoDetection(root: Union[str, Path], annFile: str, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, transforms: Optional[Callable] = None)[source]

MS Coco Detection Dataset.

It requires pycocotools to be installed, which could be installed via pip install pycocotools or conda install conda-forge::pycocotools.

Parameters:

Examples using CocoDetection:

Special-members:

__getitem__(index: int) → Tuple[Any, Any][source]

Parameters:

index (int) – Index

Returns:

Sample and meta data, optionally transformed by the respective transforms.

Return type:

(Any)