alexgkendall / SegNet-Tutorial

Files for a tutorial to train SegNet for road scenes using the CamVid dataset
http://mi.eng.cam.ac.uk/projects/segnet/tutorial.html
847 stars 517 forks source link

SegNet Tutorial Test Output #49

Closed Almo1982 closed 7 years ago

Almo1982 commented 7 years ago

Hi all,

I trained the segnet Model according to the segnet Tutorial with my own Data,everything works fine so far. I have 174 training pictures, but when i run compute_bn_statistics.py the progress bar only goes from 1/174...to 173/174 but it finishes without an error. what happens here, shouldnt it run up to 174/174?i didnt change anything within the py-file except the caffe segnet path. When i start the test segmentation file then i recognize that the input test Image n is shown in window Figure1 and in window Figure2 the Test Image n+1 is shown with some strange colored pixels. The prediction in window Figure2 seems to be correct again.

What should be correctly shown in Figure2?

Thank you!

Almo1982 commented 7 years ago

Hi again,

ok, i found my mistake, in the test.txt i only provided path to the test pic, not to the responding Label pic, this is why it takes always the test pic+1 and Shows it in window Figure1!

But this opens a much more confusing question for me...i didnt add the path to the annotation test pics because for my understanding, like the Name already says, These are "test" pics. wasnt the idea behind test pics to test the accuracy of my trained model? why should i give additional Label pics in the test Phase? Of course this is neccessary during Training and Validation Phase, but why in test Phase???

thank you

schelian commented 7 years ago

Hi @Almo1982, I was similarly confused as to why you need ground truth during testing (unless you want to compute various statistics) but I wrote down the steps to test SegNet on a new image below. @huangshichen, this may help me with #34.

  1. Resize your image to 480 columns by 360 rows
  2. Change Models/segnet_inference.prototxt to point to a different data source (line 10), e.g., myTest.txt
  3. In myTest.txt, make the first entry your resized image and pass in some random ground truth image for the second entry (e.g., CamVid/testannot/0001TP_008550.png; again the ground truth image must be 480 columns by 360 rows)

If you want to handle different sized images without resizing, you would have to retrain the network (see #6 and #37).