2
votes

For CNN training, the exact order of input image channels can be different from library to library, even model to model. For Caffe, the input image is usually expected to be in BGR order, while in Tensorflow, the order can be arbitrary.

So does anyone know for sure in what order (BGR or RGB) is the ResNet_V2 pre-trained model of Tensorflow slim library trained? It reads in the document that:

enter image description here

And I checked the script in this link: https://github.com/tensorflow/models/blob/master/research/slim/datasets/build_imagenet_data.py, it says the image is encoded in RGB. But I'm still not sure in which order is ResNet_V2 trained?

Does anyone have similar confusion about this issue? Thanks for any feedback!

1
As you mention in the question, the documentation says RGB.GPhilo

1 Answers

2
votes

It is RGB. The colorspace depends on how the image was read into memory during the data preparation. Caffe uses OpenCV for many image operations, and OpenCV defaults to reading images into BGR, while in TensorFlow universe it is more often to rely upon PIL library.

The colorspace stated in the script is RGB, see line 206.