Places365¶
- class torchvision.datasets.Places365(root: ~typing.Union[str, ~pathlib.Path], split: str = 'train-standard', small: bool = False, download: bool = False, transform: ~typing.Optional[~typing.Callable] = None, target_transform: ~typing.Optional[~typing.Callable] = None, loader: ~typing.Callable[[str], ~typing.Any] = <function default_loader>)[source]¶
Places365 分类数据集。
- 参数:
root (str or
pathlib.Path
) – Places365 数据集的根目录。split (string, optional) – 数据集划分。可以是
train-standard
(默认)、train-challenge
、val
、test
之一。small (bool, optional) – 如果为
True
,则使用小尺寸图像,即调整为 256 x 256 像素,而不是高分辨率图像。download (bool, optional) – 如果为
True
,则下载数据集组件并将其放置在root
中。已下载的压缩包不会再次下载。transform (callable, optional) – 一个函数/转换,接受 PIL 图像并返回转换后的版本。例如,
transforms.RandomCrop
target_transform (callable, optional) – 一个函数/转换,接受目标并对其进行转换。
loader – 一个根据路径加载图像的函数。
- 引发:
RuntimeError – 如果
download is False
且元文件(即 devkit)不存在或已损坏。RuntimeError – 如果
download is True
且图像压缩包已解压。
- 特殊成员: