项目作者: kamata1729

项目描述 :
Pytorch implementation of gradCAM, guidedBackProp, smoothGrad
高级语言: Python
项目地址: git://github.com/kamata1729/visualize-pytorch.git
创建时间: 2019-03-02T12:18:03Z
项目社区:https://github.com/kamata1729/visualize-pytorch

开源协议:MIT License

下载


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

  1. pip install -r requirements.txt

execute script

  1. 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