快捷方式

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-challengevaltest 之一。

  • 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 且图像压缩包已解压。

特殊成员:

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

index (int) – 索引

返回:

样本和元数据,可选地通过相应的转换进行转换。

返回类型:

(Any)

文档

访问 PyTorch 的全面开发者文档

查看文档

教程

获取面向初学者和高级开发者的深入教程

查看教程

资源

查找开发资源并获得问题解答

查看资源