projects
/
platform
/
upstream
/
caffe.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6029909
)
Correctly invert the swapping of colour channels
author
James Thewlis
<jamt9000@gmail.com>
Fri, 23 May 2014 14:59:52 +0000
(15:59 +0100)
committer
Evan Shelhamer
<shelhamer@imaginarynumber.net>
Fri, 23 May 2014 16:21:17 +0000
(09:21 -0700)
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.
python/caffe/pycaffe.py
patch
|
blob
|
history
diff --git
a/python/caffe/pycaffe.py
b/python/caffe/pycaffe.py
index
537e737
..
4827300
100644
(file)
--- a/
python/caffe/pycaffe.py
+++ b/
python/caffe/pycaffe.py
@@
-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)])
+ decaf_in = decaf_in[:, :, channel_order_inverse]
if input_scale:
decaf_in /= input_scale
return decaf_in