Skip to content

Pytorch implementation of gradCAM, guidedBackProp, smoothGrad

License

Notifications You must be signed in to change notification settings

kamata1729/visualize-pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gradCAM, guidedBackProp, smoothGrad on pytorch

Pytorch implementation of gradCAM, guidedBackProp, smoothGrad

Resnet50 is used in this implementation (also other models can be used)

dependencies

  • Python 3.6
  • torch 1.0.0
  • torchvison 0.2.1
  • cv2
  • tqdm

usage

install requirements

pip install -r requirements.txt

execute script

python main.py image_path --cuda --index hoge
  • add cuda option to use gpu

  • add index option to specify the target imagenet index of gradCAM

    Please see imagenet_class_index.json (e.g. ostrich: 9, tusker: 101)

    If not specified, target index will be estimated by the model

examples

ostrich.jpg elephant.jpg
raw
gradCAM
guidedBackProp
guidedGradCAM
smoothGrad

About

Pytorch implementation of gradCAM, guidedBackProp, smoothGrad

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages