ImageNet¶
- class torchvision.datasets.ImageNet(root: Union[str, Path], split: str = 'train', **kwargs: Any)[source]¶
ImageNet 2012 Classification Dataset.
Note
Before using this class, it is required to download ImageNet 2012 dataset from here and place the files
ILSVRC2012_devkit_t12.tar.gzandILSVRC2012_img_train.tarorILSVRC2012_img_val.tarbased onsplitin the root directory.- Parameters:
root (str or
pathlib.Path) – Root directory of the ImageNet Dataset.split (string, optional) – The dataset split, supports
train, orval.transform (callable, optional) – A function/transform that takes in a PIL image or torch.Tensor, depends on the given loader, and returns a transformed version. E.g,
transforms.RandomCroptarget_transform (callable, optional) – A function/transform that takes in the target and transforms it.
loader – A function to load an image given its path. By default, it uses PIL as its image loader, but users could also pass in
torchvision.io.decode_imagefor decoding image data into tensors directly.
- Special-members: