Skip to content

StOnEGiggity/pytorch-grad-cam

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Grad-CAM implementation in Pytorch

What makes the network think the image label is 'pug, pug-dog' and 'tabby, tabby cat':

Dog Cat

Combining Grad-CAM with Guided Backpropagation for the 'pug, pug-dog' class:

Combined

Gradient class activation maps are a visualization technique for deep learning networks.

See the paper: https://arxiv.org/pdf/1610.02391v1.pdf

The paper authors' torch implementation: https://github.com/ramprs/grad-cam

My Keras implementation: https://github.com/jacobgil/keras-grad-cam


This uses Resnet50 from torchvision. It will be downloaded when used for the first time. The code can be modified to work with any model.


Usage: python gradcam.py --image-path <path_to_image>

To use with CUDA: python gradcam.py --image-path <path_to_image> --use-cuda

About

PyTorch implementation of Grad-CAM

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%