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+Cityscapes : Accuracy issue #39

Open athus1990 opened 8 years ago

athus1990 commented 8 years ago

Hi @alexgkendall , I trained segnet(non basic non Bayesian version ) on the Cityscapes dataset(44gb of 19k+ images and annotations that need to be converted to segnet annotations). However training it on cityscapes and testing it on a new test image does not produce the same "smooth" results as shown by webcam demo. I tried to show the difference here(excuse the color difference:red is road and purple is pavement and so on:

My soln(the road and pavements are not smooth,many miscalssifications): image

Your webdemo(testing on similar image of mine): image

However on camvid testimage: image

So here goes my question: 1)webdemo was trained on ~500 images it gives great results.I trained segnet with 19k+ images and 90000+ iterations and dint change anything else.Why am I not getting a smooth performance. Should it not do better. 2)Also the cityscapes dataset has a resolution of 1024x2048 which i rescaled to 360x480 for segnet. My test image which segnet has never trained on is 1080x1920 which i rescaled to 360x480.Does resolution matter? 3)Are you testing it differently to get a smoother performance.?All I am doing is similar to testcamvid.py in ur code:

image= cv2.resize(image, (input_shape[3], input_shape[2])) input_image = image.transpose((2, 0, 1)) input_image = input_image[(2, 1, 0), :, :] input_image = np.asarray([input_image])

out = net.forward_all(data=input_image) segmentation_ind = np.squeeze(net.blobs['argmax'].data) segmentation_ind_3ch = np.resize(segmentation_ind, (3, input_shape[2], input_shape[3])) segmentation_ind_3ch = segmentation_ind_3ch.transpose(1, 2, 0).astype(np.uint8) segmentation_rgb = np.zeros(segmentation_ind_3ch.shape, dtype=np.uint8) cv2.LUT(segmentation_ind_3ch, label_colours, segmentation_rgb) segmentation_rgb = segmentation_rgb.astype(float) / 255.0

Could you please help me understand this better?

also note: -the training began with vgg16 ILSVRC pretrained encoder

also pls find the training loss: image

Timo-hab commented 8 years ago

Are you progressed? Could you successfully train and test SegNet on Cityscapes database?

athus1990 commented 8 years ago

Yea.But it is not as great as training with camvid.

varunmurali1 commented 8 years ago

Did you actually get reasonable results from training. I am still getting an output which is majority of one label. How did you run the training? Did you just fine-tune from the VGG net?

athus1990 commented 7 years ago

yes the results were great! Just not great enough.I did start with Vgg16. Converted cityscapes Annotations-->similar to Camvids and then changed the number of classes.

varunmurali1 commented 7 years ago

Could you share the trained model on the Cityscapes dataset for evaluation purposes?

athus1990 commented 7 years ago

Sure.just give me an hour

varunmurali1 commented 7 years ago

Great!

varunmurali1 commented 7 years ago

Hey @athus1990 , would it be possible to share the model?

acgtyrant commented 7 years ago

This issue can be closed now...

saviogeorge commented 6 years ago

Hi athus1990,

I was trying to train the segnet with the cityscapes data set however i get the following error Check failed: status == CUBLAS_STATUS_SUCCESS (11 vs. 0) CUBLAS_STATUS_MAPPING_ERROR I believe this is due to the difference in annotations used by the city scapes data set. annotations_problem Here you have said you have converted the cityscapes Annotations-->similar to Camvids. Can you please let me know how did you do it. some script?

guanfuchen commented 5 years ago

@athus1990 what is the mIoU about your model trained on Cityscapes, the loss does not seem to fall when the iterations increase.