Pytorch implementation of gradCAM, guidedBackProp, smoothGrad
Pytorch implementation of gradCAM, guidedBackProp, smoothGrad
Resnet50 is used in this implementation (also other models can be used)
install requirements
pip install -r requirements.txt
execute script
python main.py image_path --cuda --index hoge
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
ostrich.jpg | elephant.jpg | |
---|---|---|
raw | ![]() |
![]() |
gradCAM | ![]() |
![]() |
guidedBackProp | ![]() |
![]() |
guidedGradCAM | ![]() |
![]() |
smoothGrad | ![]() |
![]() |