mitmul / deeppose

DeepPose implementation in Chainer
http://static.googleusercontent.com/media/research.google.com/ja//pubs/archive/42237.pdf
GNU General Public License v2.0
408 stars 129 forks source link

test_sample - the mean value is not subtracted from the testing sample #3

Closed beszedes closed 9 years ago

beszedes commented 9 years ago

I'm not sure, but when it is removed within training phase then it must be removed as well in test phase.

I suggest to change code:

    net = caffe.Net(MODEL_FILE_PATH, PRETRAINED_MODEL_PATH)
    net.set_mode_gpu()

with code

    net = caffe.Classifier(MODEL_FILE_PATH, PRETRAINED_MODEL_PATH)

    net.set_mean('data', np.load(MEAN_SHAPE_PTY_PATH))  # ImageNet mean
    net.set_raw_scale('data', 255)  # the reference model operates on images in [0,255] range instead of [0,1]
    net.set_channel_swap('data', (2,1,0))  # the reference model has channels in BGR order instead of RGB
    net.set_mode_gpu()
    net.set_phase_test()
felixlaumon commented 9 years ago

In the rc2 version of caffe, There are API changes related to the gpu mode and test phase. See https://github.com/BVLC/caffe/blob/rc2/python/caffe/test/test_net.py#L38

For example,

caffe.set_mode_gpu()
...
net = caffe.Classifier(MODEL_FILE_PATH, PRETRAINED_MODEL_PATH, caffe.TEST)
mitmul commented 9 years ago

Thank you for letting me know the bugs and API changes of Caffe. Now I moved to Chainer for this project, so I close this issue.