crfasrnn icon indicating copy to clipboard operation
crfasrnn copied to clipboard

crf-rn demo vs trained algorithm

Open AlexTS1980 opened this issue 8 years ago • 6 comments

I've processed the same image through the demo (http://www.robots.ox.ac.uk/~szheng/crfasrnndemo/classify_upload) and the installed trained classifier (TVG_CRFRNN_COCO_VOC.prototxt), and I get very different results (the ones on he website are way better). An suggestion why this is the case?

AlexTS1980 avatar Mar 24 '16 13:03 AlexTS1980

We used the same model running on the background for the demo. This could be caused by the scaling issue. If you have an input image with significant large size, demo website will resize them and then feed into the model.

bittnt avatar Mar 24 '16 15:03 bittnt

I don't think it is very large, maybe 950x500. Any other possible reason you think?

AlexTS1980 avatar Mar 29 '16 08:03 AlexTS1980

If it is a gray input image, the demo script will convert them into 3-channels like image, each channel will be filled with the gray image.

For an image with resolution 950x500, you could try to resize the image into 475x250 (bilinear interpretation and keeping the ratio) and then try the demo script to see if it works the same.

bittnt avatar Mar 29 '16 09:03 bittnt

OK, so I use the first image 1502x640 in the script and in the online demo. The result from the demo is far better. When I do it with a color image, overall results are worse, but the gap between demo and script is narrower.

figure_6

figure6_2

figure6_1

AlexTS1980 avatar Mar 30 '16 12:03 AlexTS1980

Hi I don't mean to spam this board with complaining, but I am committed to making this repo work for me. I'm seeing similarly terrible results with the sample model, in CPU and GPU mode. Since my runtest fails at the multi stage meanfield test, maybe there's something just wrong with my code? By fail I mean the gradients are always dramatically incorrect for CPU, and the test seemingly gets stuck in GPU mode ( #103 )

nathanin avatar May 10 '17 00:05 nathanin

@nathanin Using an old version of Caffe will have the same result of the demo. I can confirm that. I also met same issue as you, running demo and got a lame results. I think that's because we use a newer version of caffe and need to set the crop offset. I am quite frustrated by the versioning of this repo but by searching around, eventually, still making both training and testing work.

KleinYuan avatar May 25 '17 03:05 KleinYuan