DrSleep / tensorflow-deeplab-resnet

DeepLab-ResNet rebuilt in TensorFlow
MIT License
1.25k stars 429 forks source link

Image mean question #84

Closed martiningram closed 7 years ago

martiningram commented 7 years ago

Hi DrSleep,

Thanks for this fantastic repo!

I am trying to reproduce the image mean given in train.py, but I am having a bit of trouble. I have a few questions:

  1. Is the image mean in BGR or RGB? (I am guessing BGR?)
  2. I am assuming the image mean is computed on PASCAL VOC's augmented images -- is that right?

In general, would you recommend recomputing the image mean for each new dataset (even if it's really small), or keeping it at the original?

Thank you, Martin

DrSleep commented 7 years ago
  1. You are right: it is BGR
  2. To be honest, I don't remember exactly: I have just ported it from my old caffe scripts. But it is very likely that it has been computed on the whole augmented set.
  3. Based on my experiments, there is usually no need to re-compute the mean vector. Of course, unless your dataset is at some extreme (e.g., with some colours fully missing, or with unusually low/high intensity values).
martiningram commented 7 years ago

Thanks for the fast reply. Just for reference: I computed the image mean on the augmented VOC set to be [102.93, 111.36, 116.52] in BGR. After some research, I think the one in train.py is actually the ImageNet mean (see e.g. here: https://github.com/BVLC/caffe/wiki/Models-accuracy-on-ImageNet-2012-val). I guess that makes sense, since the initial training is done there. Thanks also for your point about keeping it constant. I'll stick to the ImageNet mean for now.