快捷方式

SBU

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

SBU 带字幕照片 数据集。

参数:
  • root (str 或 pathlib.Path) – 数据集的根目录,tarball 文件 SBUCaptionedPhotoDataset.tar.gz 位于其中。

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

  • target_transform (callable, optional) – 接收目标并对其进行转换的函数/转换。

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

特殊成员:

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

index (int) – 索引

返回:

(image, target),其中 target 是照片的标题。

返回类型:

tuple

文档

访问 PyTorch 的全面开发者文档

查看文档

教程

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

查看教程

资源

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

查看资源