spyrit.misc.statistics.data_loaders_imagenet
- spyrit.misc.statistics.data_loaders_imagenet(train_root, val_root=None, img_size: int = 64, batch_size: int = 512, seed: int = 7, shuffle=False, get_size: str = 'rcrop', normalize=True, **rcrop_kwargs)[source]
- Args:
Both ‘train_root’ and ‘val_root’ need to have images in a subfolder
data_root: path to image database, expected to contain an /stl10_binary/ subfolder with the test*.bin, train*.bin and unlabeled_X.bin files.img_size: image sizebatch_size: batch sizeseed: seed, only relevant for random transformsshuffle: True to shuffle train set (test set is not shuffled)get_size: specifies how images of sizeimg_sizeare obtained‘rcrop’: random crop
‘resize’: resize
‘ccrop’: center crop
normalize: The output of torchvision datasets are images in the range [0, 1]. Settingnormalizeto True sends them to the range [-1, 1]. Whennormalizeis False, the images are left in the range [0, 1].rcrop_kwargs: Additional arguments for random crop
Note
The output of torchvision datasets are RGB images that are converted into grayscale images.