torrvision / crfasrnn

This repository contains the source code for the semantic image segmentation method described in the ICCV 2015 paper: Conditional Random Fields as Recurrent Neural Networks. http://crfasrnn.torr.vision/
Other
1.34k stars 462 forks source link

running on windows-matlab version #67

Open ghost opened 8 years ago

ghost commented 8 years ago

Has anyone tried to run the matlab version on windows?

I came across the error below:

crfrnndemo Undefined function or variable 'caffe'.

Error in caffe.resetall (line 5) caffe('reset');

Error in crfrnn_demo (line 28) caffe.reset_all();

appreciate if anyone can share how to solve the problem above.

bittnt commented 8 years ago

You should compile the caffe beforehand.

make matcaffe
ghost commented 8 years ago

Hi, thanks for the reply, but does make matcaffe work on windows? The caffe used is customized, so I didn't use caffe from [https://github.com/BVLC/caffe/tree/windows].

May I know how to compile the caffe on windows with the caffe included in crtasrnn?

ethanlee74 commented 8 years ago

@loackerc Step 1 You need to clone MS Caffe in here https://github.com/Microsoft/caffe

Step 2 You need to merge crfcnn version of this caffe manually into MS Caffe https://github.com/bittnt/caffe/tree/crfrnn

modify /src/caffe/proto/caffe.proto (You should add crfcnn specific proto buffer defs in bittnt's caffe)

added headers include/caffe/layers/meanfield_layers.hpp include/caffe/util/modified_permutohedral.hpp include/caffe/util/tvg_common_utils.hpp include/caffe/util/tvg_util.hpp added sources src/caffe/layers/meanfield_iteration.cpp src/caffe/layers/meanfield_iteration.cu src/caffe/layers/multi_stage_meanfield.cpp src/caffe/layers/multi_stage_meanfield.cu

Maybe something is forgotten. But the important point is merging crfcnn specific codes from bittnt's caffe.

Step 3 You should add all files merged in Step2 in Step1's VS solution file

and build.

When some errors, you can fix easily by googling(Hopefully)

xiewei198908 commented 8 years ago

@bittnt your latest caffe/src/caffe/util/modified_permutohedral.cpp :const float * f = (feature + k * num_dimensions); feature means features? @ethanlee74 ethanlee74 hello, According to your method, I have not been successful. Can you give me your specific process about compilation

ethanlee74 commented 8 years ago

@xiewei198908 Could you let me know your email? I'll share my modified vs solution file with all caffe rep via google drive. The size of this is approx 180M and built in 9 Sep.

xiewei198908 commented 8 years ago

@ethanlee74 znxiewei@163.com. thank you!!

ethanlee74 commented 8 years ago

@xiewei198908 // modified_permutohedral.cpp const float * f = (features + k * num_dimensions);

ethanlee74 commented 8 years ago

@xiewei198908 I sent a email with google drive link. The email address is yeonisalive@gmail.com(Don't trash it away ^^)

xiewei198908 commented 8 years ago

@ethanlee74 thinks, i successfully compile with your the source code. but When I run this code(crfasrnn-master\matlab-scripts\crfrnn_demo.m or crfrnn_demo.py) to meet a problem, which is Unexpected Standard exception from MEX file. What() is:A malformed string! ><. Couldn't read 21 values.!!!

ethanlee74 commented 8 years ago

@xiewei198908 You need to change the definition of som params in TVG_CRFRNN_new_deploy.prototxt ... multi_stage_meanfield_param { ... spatial_filter_weights_str: "3.0 3.0 3.0 3.0 3.0 3.0 3.0 3.0 3.0 3.0 3.0 3.0 3.0 3.0 3.0 3.0 3.0 3.0 3.0 3.0 3.0" bilateral_filter_weights_str: "5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0" }

You can check it in \caffe\include\caffe\util\tvg_common_utils.hpp

xiewei198908 commented 8 years ago

yes,it is ok! but effect of Image segmentation for sample.png is poor. effect of segmentation in the windows is not as good as Linux. Is there any way to improve?

ethanlee74 commented 8 years ago

@xiewei198908 It is relatively poor against the state of the art(e.g. MS COCO) But I don't know windows's is not good as Linux's So I have started my own research

Anyway crfascnn is a good starting point.

huihuangzhao commented 7 years ago

@xiewei198908 i am failed to install it in window. it troubled me two weeks. Could you please sent your version(code) to me? Many thanks