OxfordIIITPet¶
- class torchvision.datasets.OxfordIIITPet(root: Union[str, Path], split: str = 'trainval', target_types: Union[Sequence[str], str] = 'category', transforms: Optional[Callable] = None, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, download: bool = False)[源代码]¶
-
- 参数:
root (str 或
pathlib.Path
) – 数据集的根目录。split (str, optional) – 数据集划分,支持
"trainval"
(默认) 或"test"
。target_types (str, sequence of str, optional) –
要使用的目标的类型。可以是
category
(默认) 或segmentation
。也可以是列表,以输出包含所有指定目标类型的元组。类型表示:category
(int):37 种宠物类别之一的标签。binary-category
(int):猫或狗的二元标签。segmentation
(PIL image):图像的分割三图。
如果为空,则返回
None
作为目标。transform (callable, optional) – 一个函数/变换,接收 PIL 图像并返回一个变换后的版本。例如,
transforms.RandomCrop
。target_transform (可调用对象, 可选) – 一个函数/变换,接受目标并对其进行变换。
transforms (callable, optional) – 接受输入样本及其目标并返回转换后版本的函数/转换。
download (bool, optional) – 如果为 True,则从互联网下载数据集并将其放入
root/oxford-iiit-pet
。如果数据集已下载,则不会再次下载。
- 特殊成员: