STL10¶
- class torchvision.datasets.STL10(root: Union[str, Path], split: str = 'train', folds: Optional[int] = None, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, download: bool = False)[source]¶
STL10 数据集。
- 参数:
root (str 或
pathlib.Path
) – 数据集的根目录,其中存在目录stl10_binary
。split (string) – {‘train’, ‘test’, ‘unlabeled’, ‘train+unlabeled’} 之一。据此选择数据集。
folds (int, optional) – {0-9} 之一或 None。对于训练,加载 10 个预定义 folds 中的一个,每个 fold 包含 1k 个样本,用于标准评估程序。如果未传递任何值,则加载 5k 个样本。
transform (callable, optional) – 接收 PIL 图像并返回转换后版本的功能/转换。例如,
transforms.RandomCrop
target_transform (callable, optional) – 接收目标并转换它的功能/转换。
download (bool, optional) – 如果为 true,则从互联网下载数据集并将其放入根目录。如果已下载数据集,则不会再次下载。
- 特殊成员: