CSAILVision / places365

The Places365-CNNs for Scene Classification
http://places2.csail.mit.edu/
MIT License
1.93k stars 536 forks source link

Image Preprocessing: Question about Normalize mean and std values. #55

Open Vortander opened 6 years ago

Vortander commented 6 years ago

In the source code train_placesCNN.py, can someone explain me how the values at

 normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406],
                                     std=[0.229, 0.224, 0.225])

were obtained?

This values represent the mean and std RGB channel values for the whole Places 365 dataset? They are the same values of ImageNet dataset provided by PyTorch. This is correct or they should be the mean and std RGB channel values for Places dataset?

Thank you.

MasterYodah commented 6 years ago

Hi, IMHO this isn't super relevant because 1. ImageNet and Places may have similar mean and variance values since they are both large scale natural image datasets 2. these statistics will be rectified by next batchnorm layer anyway so mathematically speaking they can be learned and don't matter.

gromzhu commented 6 years ago

@MasterYodah do you know the pretrain model hybrid1365 should use which mean file?ImageNet or Places? thank you.