CocoDetection¶
- class torchvision.datasets.CocoDetection(root: Union[str, Path], annFile: str, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, transforms: Optional[Callable] = None)[源代码]¶
MS Coco Detection 数据集。
它需要安装 COCO API。
- 参数:
root (str 或
pathlib.Path
) – 图像下载到的根目录。annFile (string) – json 注释文件的路径。
transform (callable, optional) – 接收 PIL 图像并返回转换后版本的函数/转换。例如,
transforms.PILToTensor
target_transform (callable, optional) – 接收目标并对其进行转换的函数/转换。
transforms (callable, optional) – 接收输入样本及其目标作为条目并返回转换后版本的函数/转换。
使用
CocoDetection
的示例- 特殊成员: