spyrit.misc.statistics.stat_imagenet

spyrit.misc.statistics.stat_imagenet(stat_root=PosixPath('stats'), data_root=PosixPath('data/ILSVRC2012_img_test_v10102019'), img_size: int = 64, batch_size: int = 1024, get_size: str = 'resize', n_loop: int = 1, device=device(type='cpu'))[source]
Args:

stat_root: path to the folder where the mean and covariance matrices are saved

data_root: path to image database. data_root needs to have all images in a subfolder

img_size: image size

batch_size: batch size

get_size: specifies how images of size img_size are obtained (see data_loaders_imagenet)

Example:
>>> data_root =  Path('../data/ILSVRC2012_img_test_v10102019/')
>>> stat_root =  Path('../stat/ILSVRC2012_img_test_v10102019')
>>> from spyrit.misc.statistics import stat_imagenet
>>> stat_imagenet(stat_root = stat_root, data_root = data_root)