SysCV / bdd100k-models

Model Zoo of BDD100K Dataset
https://www.bdd100k.com/
Apache License 2.0
300 stars 40 forks source link

semantic segmentation inferencing on my images #15

Closed fjremnav closed 2 years ago

fjremnav commented 2 years ago

@thomasehuang

Do you have a script to do this? I have tried to use image_demo.py from mmsegmentation/demo, but it has an error.

Thanks

thomasehuang commented 2 years ago

I just use the MMSegmentation repository for training and inference, so you should look for a solution there if there is a problem.

fjremnav commented 2 years ago

@thomasehuang

I have mmsegmentation installed before and it runs OK with inferencing on my own image. Is it possible to just copy your config files into mmsegmentation config directory and download your pretrained model and use my working python script to test my own images. Do you see any problem with this approach?

Thanks,

fjremnav commented 2 years ago

I got the following error with configs/sem_seg/fcn_hr48_512x1024_80k_sem_seg_bdd100k.py and fcn_hr48_512x1024_80k_sem_seg_bdd100k.pth when image_demo.py:

File "/home/test/anaconda3/envs/remnav/lib/python3.8/site-packages/mmseg/apis/inference.py", line 35, in init_segmentor model.CLASSES = checkpoint['meta']['CLASSES'] KeyError: 'meta'

Any idea why this happens? I don't see this issue with config and trained model from mmsegmentation repository.

Thanks,

thomasehuang commented 2 years ago

@thomasehuang

I have mmsegmentation installed before and it runs OK with inferencing on my own image. Is it possible to just copy your config files into mmsegmentation config directory and download your pretrained model and use my working python script to test my own images. Do you see any problem with this approach?

Thanks,

This should be fine.

I got the following error with configs/sem_seg/fcn_hr48_512x1024_80k_sem_seg_bdd100k.py and fcn_hr48_512x1024_80k_sem_seg_bdd100k.pth when image_demo.py:

File "/home/test/anaconda3/envs/remnav/lib/python3.8/site-packages/mmseg/apis/inference.py", line 35, in init_segmentor model.CLASSES = checkpoint['meta']['CLASSES'] KeyError: 'meta'

Any idea why this happens? I don't see this issue with config and trained model from mmsegmentation repository.

Thanks,

The model checkpoints were not saved with the meta information, which is why there's an issue. I can fix this in the future, but it will take some time. For now, you can hack it to make it work by just manually setting model.CLASSES and model.PALETTE to the values here: https://github.com/SysCV/bdd100k-models/blob/main/sem_seg/datasets/bdd100k.py#L19_L61. Thanks for letting me know this issue!