SegNet-Tutorial icon indicating copy to clipboard operation
SegNet-Tutorial copied to clipboard

Segnet+Cityscapes : Accuracy issue

Open athus1990 opened this issue 9 years ago • 11 comments

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

athus1990 avatar Apr 28 '16 17:04 athus1990

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

Timo-hab avatar Jun 22 '16 09:06 Timo-hab

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

athus1990 avatar Jun 22 '16 20:06 athus1990

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?

varunmurali1 avatar Jul 05 '16 23:07 varunmurali1

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.

athus1990 avatar Jul 14 '16 16:07 athus1990

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

varunmurali1 avatar Jul 14 '16 17:07 varunmurali1

Sure.just give me an hour

athus1990 avatar Jul 14 '16 17:07 athus1990

Great!

varunmurali1 avatar Jul 14 '16 18:07 varunmurali1

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

varunmurali1 avatar Jul 15 '16 13:07 varunmurali1

This issue can be closed now...

acgtyrant avatar Dec 28 '16 05:12 acgtyrant

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?

saviogeorge avatar Jul 19 '17 10:07 saviogeorge

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

guanfuchen avatar Nov 21 '18 06:11 guanfuchen