I am trying to determine whether ilsvrc_2012_mean.npy (and imagenet_mean.binaryproto) is in BGR or RGB. From the data loaded, the means for channels 0, 1 and 2 are 104,116.7 and 122.7 respectively, but i am unsure their order.
From the notebok tutorial on image recognition, the net is set so that the channels are swapped from RGB to BGR. The cat is RGB, the net swaps it to BGR and then subtracts the mean with ilsvrc_2012_mean.npy. So ilsvrc_2012_mean.npy must be BGR if I understand pycaffe.py correctly (the preprocessing swaps the channels then subtract the means).
Now ilsvrc_2012_mean.npy was generated using compute_image_mean.cpp which takes the input a leveldb file generated by convert_imageset.cpp. So this implies that at some stage one of these tools swapped RGB to BGR. I am guessing convert_imageset.cpp does that.
Please correct me if I made any mistakes above as I have only superficial knowledge of Caffe's internals. Thanks.