Update ilsvrc_2012_mean.mat to W x H x C, update demo and add comments#2527
Conversation
0d2682b to
a399dea
Compare
|
It seems that travis install failed It seems that travis failed to download |
a399dea to
cb3cb25
Compare
|
@ronghanghu it was probably a passing network issue. I just toggled the PR to re-trigger the tests -- not that this PR should change the results anyway. |
|
@shelhamer But I cannot download the LMDB in travis_install.sh either from my laptop or kraken machine. There seems to be something wrong with it. Maybe http://www.openldap.org/ is under maintenance at this moment. Update: the link above seems to have resurrected a few minutes ago |
cb3cb25 to
fd4ab97
Compare
Update previously ilsvrc_2012_mean.mat stores 'image_mean' variable in H x W x C with BGR channels, which is inconsistent with Caffe's data format and inconsistent with caffe.io.read_mean(..). Replace 'image_mean' with 'mean_data' variable in W x H x C and update classification_demo.m. Also add some comments.
fd4ab97 to
97b4c14
Compare
switch ilsvrc_2012_mean.mat to W x H x C, update demo and add comments
This PR addresses #2505 (comment)
In MatCaffe, there are currently two (conflicting) ways to load mean:
image_meanvariable in height x width x 3, BGR channels. This is inconsistent with the way caffe stores data (WxHxCxN in Matlab).caffe.io.read_mean('./data/ilsvrc12/imagenet_mean.binaryproto'), which is also inherited from old wrapper, returnsmean_datain width x height x 3 (also BGR channels), which is consistent with the way a caffe's blob stores data.The inconsistency in ilsvrc_2012_mean.mat is very likely to confuse users when doing mean subtraction. Although this issue also existed in the old Matlab wrapper, it should be addressed somehow.
So this PR permute height and width in caffe/matlab/+caffe/imagenet/ilsvrc_2012_mean.mat, use a new variable name
mean_datainstead ofimage_meanin that file, and update classification_demo.m. Also, some comments are added in classification_demo.m and io.m (and also handle grayscale images).