Open pranshushah opened 7 years ago
I got the same result as yours. mean = [0.4913997551666284, 0.48215855929893703, 0.4465309133731618] std = [0.24703225141799082, 0.24348516474564, 0.26158783926049628]
actually i got result from fb code but i just want know the order of the mean and std.. is it in bgr or rgb
@pranshushah the mean is in RGB order
Try this:
import numpy as np
# load data
from torchvision import datasets
# load the training data
train_data = datasets.CIFAR10('./cifar10_data', train=True, download=True)
# use np.concatenate to stick all the images together to form a 1600000 X 32 X 3 array
x = np.concatenate([np.asarray(train_data[i][0]) for i in range(len(train_data))])
# print(x)
print(x.shape)
# calculate the mean and std along the (0, 1) axes
train_mean = np.mean(x, axis=(0, 1))
train_std = np.std(x, axis=(0, 1))
# the the mean and std
print(train_mean, train_std)
meanstd = { mean = {125.3, 123.0, 113.9}, std = {63.0, 62.1, 66.7}, } is these values are in rgb or bgr order??