Use mean file in hdf5 in caffe
<p>I'm preparing to train in Caffe using data in a hdf5 file. This file also contains the per-pixel mean data/image of the training set. In the file <code>'train_val.prototxt'</code> for the input data layer in the section <code>'transform_params'</code> it is possible to use a <code>mean_file</code> to normalize the data, usually in binaryproto format, for example for the <a href="http://caffe.berkeleyvision.org/gathered/examples/imagenet.html" rel="nofollow">ImageNet Caffe tutorial example</a>:</p>

<pre><code>transform_param {
  mirror: true
  crop_size: 227
  mean_file: "data/ilsvrc12/imagenet_mean.binaryproto"
}
</code></pre>

<p>For per-channel normalization one can instead use <a href="https://github.com/BVLC/caffe/blob/master/models/bvlc_reference_caffenet/train_val.prototxt" rel="nofollow">mean_value</a> instead of mean_file.</p>

<p>But is there any way to use mean image data directly from my database (here hdf5) file?</p>

<p>I have extracted the mean from the hdf5 to a numpy file but not sure if that can be used in the prototxt either or converted. I can't find info about this in the Caffe documentation.</p>