快捷方式

Country211

class torchvision.datasets.Country211(root: Union[str, Path], split: str = 'train', transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, download: bool = False)[source]

来自 OpenAI 的 Country211 数据集。

该数据集通过过滤 YFCC100m 数据集中具有与 ISO-3166 国家代码对应的 GPS 坐标的图像而构建。该数据集通过为每个国家/地区采样 150 张训练图像、50 张验证图像和 100 张测试图像来保持平衡。

参数:
  • root (str 或 pathlib.Path) – 数据集的根目录。

  • split (string, optional) – 数据集划分,支持 "train" (默认), "valid""test"

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

  • target_transform (callable, optional) – 接收目标并转换它的功能/转换。

  • download (bool, optional) – 如果为 True,则从互联网下载数据集并将其放入 root/country211/。如果数据集已下载,则不会再次下载。

特殊成员:

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

index (int) – 索引

返回:

(sample, target),其中 target 是目标类别的 class_index。

返回类型:

tuple (元组)

文档

访问 PyTorch 的全面开发者文档

查看文档

教程

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

查看教程

资源

查找开发资源并获得解答

查看资源