Skip to content

Implementation of the Grad-CAM algorithm in an easy-to-use class, optimized for transfer learning projects and written using Keras and Tensorflow 2.x

Notifications You must be signed in to change notification settings

andreafortini/gradcam-tf2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GRADCAM

Implementation of the Grad-CAM algorithm in an easy-to-use class, optimized for transfer learning projects and written using Keras and Tensorflow 2.x.

Requirement

  • Python 3.6.x
  • Matplotlib 3.4.x
  • Numpy 1.19.x
  • Tensorflow 2.4.x

Usage

Please take a look of examples folder for a complete example.

from gradcam import Gradcam

gc = Gradcam(model, 
             layer_name="top_conv",
             img_path=img_path,
             size=img_size,
             inner_model=model.get_layer("efficientnetb0"))

gc.generate_stack_img(save_name="../output/example_out")

output image

Reference

[1] Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization.

About

Implementation of the Grad-CAM algorithm in an easy-to-use class, optimized for transfer learning projects and written using Keras and Tensorflow 2.x

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages