zh320 / realtime-semantic-segmentation-pytorch

PyTorch implementation of over 30 realtime semantic segmentations models, e.g. BiSeNetv1, BiSeNetv2, CGNet, ContextNet, DABNet, DDRNet, EDANet, ENet, ERFNet, ESPNet, ESPNetv2, FastSCNN, ICNet, LEDNet, LinkNet, PP-LiteSeg, SegNet, ShelfNet, STDC, SwiftNet, and support knowledge distillation, distributed training etc.
Apache License 2.0
78 stars 14 forks source link

How can I change codes for submiting label ID png to test? #15

Closed zhy168 closed 2 weeks ago

zhy168 commented 1 month ago

I want to use my model to predict test set and save label ID png for submiting result to cityscapes web and get tested.Is there any option to save predict png without using colormap? thanks a lot !

zhy168 commented 1 month ago

image If I coment line 171 can work?

zh320 commented 2 weeks ago

Hi, to submit your results to cityscapes please refer to the official documents of cityscapes.

If you want to save predict png without using colormap, you may change the following codes

https://github.com/zh320/realtime-semantic-segmentation-pytorch/blob/0e5fe540f13c91d36ec30e745dc151ad356d3fd4/core/seg_trainer.py#L168

into

preds = preds.max(dim=1)[1].cpu().numpy()

Best,