pytorch-grad-cam
pytorch-grad-cam copied to clipboard
Implement SegGradCAM based on pytorch-grad-cam
Hi all,
Thank you for the effort of developing this code in PyTorch. I am recently investigating semantic segmentation networks with CAM. And wrote a few adaptors to accommodate segmentation nets.
pytorch_grad_cam/utils/roi.py
The original code is written in keras: https://github.com/kiraving/SegGradCAM/
My code contains several ROI definitions to aggregate values for CAM analysis. Some of them contain interactive tools allowing users to pick a pixel/region for analysis.
The segcam.py shows the usage of my code.
Hope it will make the project more powerful.
Thanks, Shaun
Hi, thanks a lot, this is impressive.
I'm looking into this, might take me about a week.
There seem to be some minor bugs: --roimode 2 returns me an error, and it doesn't work with --use-cuda. Is --roimode 2 supposed to work?
Thanks for your reviewing.
Yes, the roimode 2 is supposed to work and I have already fixed it.
As well as working together with the --use-cuda flag, I fixed it by transfer the tensor to the same device as the model.
Thank you, Shaun