Why FCN infer.py output is a 1-channel Mat, how can I convert to 3-channel RGB Format?

42 views
Skip to first unread message

gyh...@gmail.com

unread,
Sep 14, 2016, 2:52:56 AM9/14/16
to Caffe Users

I download and run the default infer.py script of FCN from github:

 https://github.com/shelhamer/fcn.berkeleyvision.org

The output of "score" layer is just 1-channel Mat and can not be converted to RGB img, I know the raw output blob of score layer is [1, 21, W, H], but how can I get a 3-channel RGB output instead of 1-channel img? I have tried change the input data layer from [1,3,W,H] to [3,3,W,H] and use PIL.Image.convert('RGB'), however, Both failed. 

I am a start learner in Image Segmentation, any suggestion is helpful and thanks a lot~

Source code in infer.py, which out.shape = [W, H] (namely 1-channel not 3):

out = net.blobs['score'].data[0].argmax(axis=0)
Reply all
Reply to author
Forward
0 new messages