alexgkendall / caffe-segnet

Implementation of SegNet: A Deep Convolutional Encoder-Decoder Architecture for Semantic Pixel-Wise Labelling
http://mi.eng.cam.ac.uk/projects/segnet/
Other
1.08k stars 452 forks source link

processing 4-channel images #47

Open Pepslee opened 8 years ago

Pepslee commented 8 years ago

Can SegNet process 4-channel ( or more channel ) images ? What i need to change in source code, to process more then 3 channel images ?

alexgkendall commented 8 years ago

Yes absolutely. However PNG images in general cannot handle n-channel tensors. You will need to use another layer to input data. One option might be to arrange your data into an LMDB dataset and use the standard caffe data layer. Or you could modify the dense image data layer to support this.

Pepslee commented 8 years ago

Why can't I use 4-channel .png image, or 4-channel .tif image ? Opencv imread can open 4-channel image, using CV_LOAD_UNCHANGED flag.

alexgkendall commented 8 years ago

Sure, you could do that. You'd need to make some changes to the dense_image_data_layer

leihamilton commented 8 years ago

Hi, @alexgkendall, I would like to try RGBD data on SegNet, I followed your suggestions and created a lmdb database for RGBD, and a lmdb database for label. In the original SegNet, the data is first pasted into the NORM layer. My questions is that do I still pass the RGBD to the NORM layer? Thanks.

Pepslee commented 8 years ago

Hi, alexgkendall , you said, that to process 4-channel images, I need to make some changes to the dense_image_data_layer. I made some changes to the ReadImageToCVMat function, to provide 4-channel image loading. But I have some strenge result , there are some vertical lines on the output mask. These vertical lines appear every 4 pixels, ie problem for the 4-th channel. Would I need to make some changes in the upsample_layer or in the compute_bn_statistic_py code ?????