Shortcuts

国家211

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

The Country211 Data Set 来自 OpenAI。

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

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

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

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

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

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

Special-members:

__getitem__(index: int) Tuple[Any, Any]
Parameters:

index (int) – 索引

Returns:

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

Return type:

tuple