Food101¶
- class torchvision.datasets.Food101(root: Union[str, Path], split: str = 'train', transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, download: bool = False)[source]¶
-
Food-101 是一个具有挑战性的数据集,包含 101 个食物类别和 101,000 张图像。对于每个类别,都提供了 250 张手动审核的测试图像以及 750 张训练图像。有意地,训练图像未经过清理,因此仍然包含一定量的噪声。这主要以强烈的颜色和有时错误的标签的形式出现。所有图像都经过缩放,使其最大边长为 512 像素。
- 参数:
root (str 或
pathlib.Path
) – 数据集的根目录。split (string, 可选) – 数据集划分,支持
"train"
(默认) 和"test"
。transform (callable, 可选) – 接收 PIL 图像并返回转换后版本的函数/变换。例如,
transforms.RandomCrop
。target_transform (callable, 可选) – 接收目标并对其进行转换的函数/变换。
download (bool, 可选) – 如果为 True,则从互联网下载数据集并将其放在根目录中。如果数据集已下载,则不会再次下载。默认为 False。
- 特殊成员: