快捷方式

SEMEION

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

SEMEION 数据集。

参数:
  • root (str 或 pathlib.Path) – 数据集的根目录,其中包含 semeion.py 文件。

  • transform (callable, 可选) – 一个函数/转换,输入 PIL 图像并返回转换后的版本。例如,transforms.RandomCrop

  • target_transform (callable, 可选) – 一个函数/转换,输入目标并对其进行转换。

  • download (bool, 可选) – 如果为 True,则从互联网下载数据集并将其放在 root 目录中。如果数据集已下载,则不再重复下载。

特殊成员:

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

index (int) – 索引

返回:

(图像, 目标),其中目标是目标类别的索引。

返回类型:

tuple

文档

查阅 PyTorch 的完整开发者文档

查看文档

教程

获取针对初学者和高级开发者的深度教程

查看教程

资源

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

查看资源