Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly invert the swapping of colour channels in Python API 'deprocess' #443

Merged
merged 1 commit into from
May 23, 2014

Conversation

jamt9000
Copy link
Contributor

In the 'deprocess' method, get back the image with the original channel order
by inverting the original transform, rather than reversing the tuple which is
incorrect.

In the 'deprocess' method, get back the image with the original channel order
by inverting the original transform, rather than reversing the tuple which is
incorrect.
shelhamer added a commit that referenced this pull request May 23, 2014
Correctly invert the swapping of colour channels in Python API 'deprocess'
@shelhamer shelhamer merged commit 0cd46b2 into BVLC:dev May 23, 2014
@shelhamer
Copy link
Member

Thanks for the fix! Cherry-picked to master in 191367f. Edit: Sorry, I didn't catch that the invert only does it for three channels. This method should support k input channels. I'll adjust then cherry-pick to master.

@@ -284,7 +284,8 @@ def _Net_deprocess(self, input_name, input_):
decaf_in += mean
decaf_in = decaf_in.transpose((1,2,0))
if channel_order:
decaf_in = decaf_in[:, :, channel_order[::-1]]
channel_order_inverse = tuple([channel_order.index(i) for i in (0,1,2)])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for i in range(decaf_in.shape[2]) to support any number of channels.

@shelhamer
Copy link
Member

Fix brought to master in e5fcf03 and 211c3c2. Thanks again @jamt9000!

shelhamer added a commit that referenced this pull request May 25, 2014
fix OSX 10.9 compiler/stdlib override for latest homebrew
follow-up on #443 to invert k channels (instead of 3)
Correctly invert the swapping of colour channels
link presentation on dropbox (was self-hosted during a dropbox issue)
link to demo
fix draw_net python script
release v1 model defs + weights
point out @niuzhiheng's work on the Windows port
fix test_all path in docs
link canonical bvlc site
fix detection notebook link
mitmul pushed a commit to mitmul/caffe that referenced this pull request Sep 30, 2014
Correctly invert the swapping of colour channels in Python API 'deprocess'
mitmul pushed a commit to mitmul/caffe that referenced this pull request Sep 30, 2014
mitmul pushed a commit to mitmul/caffe that referenced this pull request Sep 30, 2014
mitmul pushed a commit to mitmul/caffe that referenced this pull request Sep 30, 2014
fix OSX 10.9 compiler/stdlib override for latest homebrew
follow-up on BVLC#443 to invert k channels (instead of 3)
Correctly invert the swapping of colour channels
link presentation on dropbox (was self-hosted during a dropbox issue)
link to demo
fix draw_net python script
release v1 model defs + weights
point out @niuzhiheng's work on the Windows port
fix test_all path in docs
link canonical bvlc site
fix detection notebook link
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants