KMNIST¶
- class torchvision.datasets.KMNIST(root: Union[str, Path], train: bool = True, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, download: bool = False)[source]¶
Kuzushiji-MNIST 数据集。
- Parameters:
root (str 或
pathlib.Path) – 数据集的根目录,其中包含KMNIST/raw/train-images-idx3-ubyte和KMNIST/raw/t10k-images-idx3-ubyte文件。train (bool, 可选) – 如果为True,则从
train-images-idx3-ubyte创建数据集, 否则从t10k-images-idx3-ubyte创建。下载 (bool, 可选) – 如果为True,则从互联网下载数据集并将其放在根目录中。如果数据集已经下载,则不会再次下载。
transform (callable, optional) – 一个函数/变换,它接收一个PIL图像并返回一个变换后的版本。例如,
transforms.RandomCroptarget_transform (callable, optional) – 一个函数/转换,它接收目标并对其进行转换。
- Special-members: