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 = 'original')[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‘original’: random crop with padding
‘resize’: resize
‘ccrop’: center crop
‘rcrop’: random crop
The output of torchvision datasets are PILImage images in the range [0, 1]. We transform them to Tensors in the range [-1, 1]. Also RGB images are converted into grayscale images.