Commit 3d0bb706 authored by Patrick Wieschollek's avatar Patrick Wieschollek Committed by Yuxin Wu

fix VGG-mean substraction (#518)

parent f20e411a
...@@ -83,9 +83,9 @@ def run_test(path, input): ...@@ -83,9 +83,9 @@ def run_test(path, input):
# VGG16 requires channelwise mean substraction # VGG16 requires channelwise mean substraction
VGG_MEAN = [103.939, 116.779, 123.68] VGG_MEAN = [103.939, 116.779, 123.68]
im[:, :, 0] -= VGG_MEAN[2] im[:, :, :, 0] -= VGG_MEAN[2]
im[:, :, 1] -= VGG_MEAN[1] im[:, :, :, 1] -= VGG_MEAN[1]
im[:, :, 2] -= VGG_MEAN[0] im[:, :, :, 2] -= VGG_MEAN[0]
outputs = predict_func(im)[0] outputs = predict_func(im)[0]
prob = outputs[0] prob = outputs[0]
......
...@@ -79,9 +79,9 @@ def run_test(path, input): ...@@ -79,9 +79,9 @@ def run_test(path, input):
# VGG19 requires channelwise mean substraction # VGG19 requires channelwise mean substraction
VGG_MEAN = [103.939, 116.779, 123.68] VGG_MEAN = [103.939, 116.779, 123.68]
im[:, :, 0] -= VGG_MEAN[2] im[:, :, :, 0] -= VGG_MEAN[2]
im[:, :, 1] -= VGG_MEAN[1] im[:, :, :, 1] -= VGG_MEAN[1]
im[:, :, 2] -= VGG_MEAN[0] im[:, :, :, 2] -= VGG_MEAN[0]
outputs = predict_func(im)[0] outputs = predict_func(im)[0]
prob = outputs[0] prob = outputs[0]
ret = prob.argsort()[-10:][::-1] ret = prob.argsort()[-10:][::-1]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment