StanfordCars¶
- class torchvision.datasets.StanfordCars(root: Union[str, Path], split: str = 'train', transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, download: bool = False)[source]¶
Stanford Cars 数据集
Cars 数据集包含 196 个汽车类别的 16,185 张图像。数据分为 8,144 张训练图像和 8,041 张测试图像,其中每个类别都大致分为 50-50。
原始 URL 是 https://ai.stanford.edu/~jkrause/cars/car_dataset.html,但已损坏。请按照
download
参数中的说明离线获取和使用数据集。注意
此类需要 scipy 以从 .mat 格式加载目标文件。
- 参数:
root (str 或
pathlib.Path
) – 数据集的根目录split (string, optional) – 数据集拆分,支持
"train"
(默认) 或"test"
。transform (callable, optional) – 接收 PIL 图像并返回转换后版本的功能/转换。例如,
transforms.RandomCrop
target_transform (callable, optional) – 接收目标并对其进行转换的功能/转换。
download (bool, optional) – 此参数是为了向后兼容而存在的,但它不会下载数据集,因为原始 URL 不再可用。数据集似乎在 Kaggle 上可用,因此您可以尝试手动下载并使用 这些说明 配置它,或者使用 Kaggle 上的集成 数据集。在这两种情况下,请先在本地下载并配置数据集,然后使用
"download=False"
使用数据集。
- 特殊成员: