Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

the value of mean, std in cifar-10 #180

Open
pranshushah opened this issue May 3, 2017 · 4 comments
Open

the value of mean, std in cifar-10 #180

pranshushah opened this issue May 3, 2017 · 4 comments

Comments

@pranshushah
Copy link

meanstd = {
mean = {125.3, 123.0, 113.9},
std = {63.0, 62.1, 66.7},
}
is these values are in rgb or bgr order??

@zhyx12
Copy link

zhyx12 commented Jul 3, 2017

I got the same result as yours.
mean = [0.4913997551666284, 0.48215855929893703, 0.4465309133731618]
std = [0.24703225141799082, 0.24348516474564, 0.26158783926049628]

@pranshushah
Copy link
Author

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

@sreelu1995
Copy link

@pranshushah the mean is in RGB order

@paulkorir
Copy link

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants