pytorch-grad-cam icon indicating copy to clipboard operation
pytorch-grad-cam copied to clipboard

Implement SegGradCAM based on pytorch-grad-cam

Open sxsong1207 opened this issue 4 years ago • 2 comments

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

sxsong1207 avatar May 26 '21 23:05 sxsong1207

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?

jacobgil avatar May 28 '21 13:05 jacobgil

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

sxsong1207 avatar May 28 '21 16:05 sxsong1207