快捷方式

Omniglot

torchvision.datasets.Omniglot(root: Union[str, Path], background: bool = True, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, download: bool = False)[source]

Omniglot 数据集。

参数:
  • root (str 或 pathlib.Path) – 数据集的根目录,其中存在 omniglot-py 目录。

  • background (bool, optional) – 如果为 True,则从“background”集创建数据集,否则从“evaluation”集创建。此术语由作者定义。

  • transform (callable, optional) – 一个函数/变换,它接收 PIL 图像并返回变换后的版本。例如,transforms.RandomCrop

  • target_transform (callable, optional) – 一个函数/变换,它接收目标并对其进行变换。

  • download (bool, optional) – 如果为 true,则从互联网下载数据集 zip 文件并将其放在根目录中。如果 zip 文件已下载,则不会再次下载。

特殊成员:

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

index (int) – 索引

返回:

(image, target),其中 target 是目标字符类的索引。

返回类型:

元组

文档

访问全面的 PyTorch 开发者文档

查看文档

教程

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

查看教程

资源

查找开发资源并获得解答

查看资源