meetps / pytorch-semseg

Semantic Segmentation Architectures Implemented in PyTorch
https://meetshah.dev/semantic-segmentation/deep-learning/pytorch/visdom/2017/06/01/semantic-segmentation-over-the-years.html
MIT License
3.38k stars 798 forks source link

Camvid Segnet unlabelled problem #58

Open andyhahaha opened 6 years ago

andyhahaha commented 6 years ago

I use this code to train segnet on camvid, but the results can't reach the paper performance. I found that you didn't use median-frequency balancing to training. Moreover, unlabelled class is '11', not '<0', so you didn't ignore unlabelled pixel at training and validate. Your segnet will output unlabelled class that is weird. You should change n_class=12 to n_class=11.

d-li14 commented 6 years ago

Could you please tell me how the split of 'train', 'val', 'test' is done in advance in camvid_loader.py? As I can see, the original dataset take them as a whole 701_StillsRaw_full folder.

andyhahaha commented 6 years ago

I follow the split from this repo. https://github.com/alexgkendall/SegNet-Tutorial This is the repo from segnet author alex kendall.

d-li14 commented 6 years ago

@andyhahaha Thanks a lot for reminding me, and I got the split from SegNet repo. But there exists some conflicts with the CamVid official site as far as i know:

d-li14 commented 6 years ago

@andyhahaha Furthermore, as for your original question, I think shrinking n_class to 11 naively won't work, because if so, the network will output 11 classes while the ground truth still contains the 12nd class, this will lead to an unexpected error in cross entropy. And in my opinion you'd better set an ignore_index to exclude the unlabeled "void" class, which can be refered to in the loader of CityScapes dataset as well.

guanfuchen commented 6 years ago

same problem, and I wonder whether the color map is not same with the origin paper. I try to test like blew:

label_colours = np.array([Sky, Building, Pole, Road, Pavement, Tree, 
                              SignSymbol, Road_marking, Car, 
                              Pedestrian, Fence, Unlabelled])
komms commented 5 years ago

@andyhahaha @d-li14 did you implement class balancing in the CamVid? How did you deal with unlabelled class?