-->

What is the order of mean values in Caffe's tr

2020-07-18 05:19发布

问题:

In my Caffe 'train.prototxt' I'm doing some input data transformation, like this:

  transform_param {
    mirror: true
    crop_size: 321
    mean_value: 104 # Red ?
    mean_value: 116 # Blue ? 
    mean_value: 122 # Green ? 
  }

Now I want to store a modified version of my input images such that certain image regions are set to those mean values. The rational is that those regions are then set to 0 during mean subtraction. However I don't know what the order of channels is that caffe expects in such a prototxt file and I couldn't look it up in the caffe code either.
Does someone now whether the 3 values given above are in RGB or BGR order?

(I'm not sure since caffe is using opencv internally which stores images in the unusual BGR format)

回答1:

https://groups.google.com/forum/#!topic/caffe-users/9opH6AW3Irw (answer by Evan Shelhamer):

[Mean] values are BGR for historical reasons -- the original CaffeNet training lmdb was made with image processing by OpenCV which defaults to BGR order.