Skip to content

Commit 211c3c2

Browse files
committed
follow-up on #443 to invert k channels (instead of 3)
1 parent e5fcf03 commit 211c3c2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/caffe/pycaffe.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ def _Net_deprocess(self, input_name, input_):
284284
decaf_in += mean
285285
decaf_in = decaf_in.transpose((1,2,0))
286286
if channel_order:
287-
channel_order_inverse = tuple([channel_order.index(i) for i in (0,1,2)])
287+
channel_order_inverse = [channel_order.index(i)
288+
for i in range(decaf_in.shape[2])]
288289
decaf_in = decaf_in[:, :, channel_order_inverse]
289290
if input_scale:
290291
decaf_in /= input_scale

0 commit comments

Comments
 (0)