hellochick / ICNet-tensorflow

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

About RGB-BGR conversion in preprocess() in inference and evaluate #79

Closed Sparkofska closed 5 years ago

Sparkofska commented 5 years ago

Hi there, I have a question concerning the preprocessing part in evaluate.py and inference.py: The channels get swapped from RGB to BGR, but I cannot find such a swapping in train.py. Why is it applied and did I miss it in train.py?

hellochick commented 5 years ago

Hey, Since I used the image queue in training phase, which is different with inference and evaluation. You can find the pre-processing part in image_reader.py.

Sparkofska commented 5 years ago

Thanks for the quick reply. But I'm still wondering why a channel swapping (RGB to BGR conversion) is necessary?

hellochick commented 5 years ago

Since the pre-trained weight from original author is based on caffe, which use BGR color space. However, tensorflow read images using RGB color space.

Sparkofska commented 5 years ago

OK, simple answer, got it. Thank you very much!