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

Saving SegNet test results under SegNet/Models/predictions #120

Open pooyan1982 opened 6 years ago

pooyan1982 commented 6 years ago

Hi all,

The following code snippet is by default commented out in test_segmentation_camvid.py:

scipy.misc.toimage(rgb, cmin=0.0, cmax=255).save(IMAGE_FILE+'_segnet.png')

I believe the author meant to have the following instead (Note the difference in the params passed into the function):

scipy.misc.toimage(rgb, high=255, low=0.0).save(IMAGE_FILE+'_segnet.png')

When I used the default code, all the images (rgb, rgb_gt and image) would be saved as an entirely black image. When I changed it to high rather than cmax and low rather than cmin, it stored all the images as expected :)

@alexgkendall Alex, please confirm the above if you get a chance and if so, please change it in the repo so everyone can get the update. Thanks in advance for your contribution.

HaoWumarz commented 6 years ago

Hi Do you know how to define the IMAGE_FILE and save the results? thank you

JessieFeng97 commented 5 years ago

@HaoWumarz you can just put the absolute path that you want to save the image and + str(i) to substitute the "IMAGE_FILE" there