NVlabs / SegFormer

Official PyTorch implementation of SegFormer
https://arxiv.org/abs/2105.15203
Other
2.58k stars 357 forks source link

problem of visualize #155

Closed Gatswei closed 6 days ago

Gatswei commented 3 months ago

Great work! I met a problem when I try to visualize. How can I solve this problem? python demo/image_demo.py demo/demo.png local_configs/segformer/B1/segformer.b1.512x512.ade.160k.py /data/segformer.b1.512x512.ade.160k.pth --device cuda:0 --palette cityscapes Use load_from_local loader Traceback (most recent call last): File "demo/image_demo.py", line 29, in main() File "demo/image_demo.py", line 25, in main show_result_pyplot(model, args.img, result, get_palette(args.palette)) File "/code/SegFormer-master/mmseg/apis/inference.py", line 115, in show_result_pyplot img = model.show_result(img, result, palette=palette, show=False) File "/code/SegFormer-master/mmseg/models/segmentors/base.py", line 246, in show_result assert palette.shape[0] == len(self.CLASSES) AssertionError

mangoggul commented 2 weeks ago

you need to change "--palette cityscapes" to "--palette ade" i dont know why this error doesnt changed in readme