open-mmlab / mmsegmentation

OpenMMLab Semantic Segmentation Toolbox and Benchmark.
https://mmsegmentation.readthedocs.io/en/main/
Apache License 2.0
8.23k stars 2.61k forks source link

vis_cam.py in mmsegmenation #2032

Open yuanyuangoo opened 2 years ago

yuanyuangoo commented 2 years ago

Can we have a grad-cam-like tool to visualize feature maps, like in vis_cam.py in misclassification?

MeowZheng commented 2 years ago

of course, we have supported very powerful visualization tool in mmseg 1.0.0rc0, you can try it

reference https://github.com/open-mmlab/mmengine/blob/cfb884c180e97454b14b1dc12bac21bd376f82db/mmengine/visualization/visualizer.py#L119-L124 https://github.com/open-mmlab/mmsegmentation/blob/1.x/docs/en/user_guides/visualization.md

yuanyuangoo commented 2 years ago

Thanks for the response. How do I get a feat-map of a certain layer after I trained a model using mmsegmentation and got weights?

MeowZheng commented 2 years ago

Just save any tensor map like below as you want, then load it ant see it with the visualization tool.

https://github.com/open-mmlab/mmsegmentation/blob/b51670b61339e5b10c5ab6c277de6b6a387fdff0/mmseg/models/decode_heads/dpt_head.py#L287

shigejiafeimao commented 2 years ago

Just save any tensor map like below as you want, then load it ant see it with the visualization tool.

https://github.com/open-mmlab/mmsegmentation/blob/b51670b61339e5b10c5ab6c277de6b6a387fdff0/mmseg/models/decode_heads/dpt_head.py#L287

could you speak in details? I also want to know. please!

shigejiafeimao commented 2 years ago

Just save any tensor map like below as you want, then load it ant see it with the visualization tool.

https://github.com/open-mmlab/mmsegmentation/blob/b51670b61339e5b10c5ab6c277de6b6a387fdff0/mmseg/models/decode_heads/dpt_head.py#L287

if i use sep_aspp_head.py,how to get a feat-map?

duduzai2019 commented 1 year ago

Can we have a grad-cam-like tool to visualize feature maps, like in vis_cam.py in misclassification?

Hi, have you solved it?

duduzai2019 commented 1 year ago

Hi, have you solved it?

Hi, can you solved it?

shenxiangkei commented 1 year ago

Have you found a suitable solution, I have a similar problem