hellochick / ICNet-tensorflow

TensorFlow-based implementation of "ICNet for Real-Time Semantic Segmentation on High-Resolution Images".
405 stars 153 forks source link

IMG_MEAN Questions #71

Closed AlexanderLeipnitz closed 5 years ago

AlexanderLeipnitz commented 6 years ago

Hello, I have some questions regarding the mean value subtraction:

  1. Where is the IMG_MEAN value IMG_MEAN = np.array((103.939, 116.779, 123.68), dtype=np.float32) coming from and why is it the same for the Cityscapes and ADE20K dataset?
  2. Do I have to change it when training with my own dataset from scratch or by finetuning a pretrained model?
  3. Why don't you use img = tf.image.per_image_standardization(img) and instead use the fixed MEAN value?
hellochick commented 6 years ago
  1. I use the same value because I think it would not affect much. What I want to do is to let the RGB value range between [-128~128].

  2. I think you can use the same value when training on your own dataset.

  3. If you use the tf.Dataset api to load your own dataset, you can try to use this function, it will be much more convenient when pre-processing.