jacobgil / keras-grad-cam

An implementation of Grad-CAM with keras
MIT License
656 stars 237 forks source link

Grad-Cam for custom defined architecture #23

Open abhigoku10 opened 5 years ago

abhigoku10 commented 5 years ago

@jacobgil @twuilliam Hi thanks for the wonderful code , i had few queries

  1. Can we use this source code for any other architecture besides vg16/ resnet/customized architecture
  2. If we have to use this code then what are the modficiations to be made in the code Thnaks in advance
jenskrauth commented 5 years ago

Hey, first of all load your own Model instead of VGG.

  1. Apply your own Preprocessing depending on Model.
  2. In modify_backprop re-instanciate your own Model.
  3. in gradcam() resize the heatmap to you input size.
  4. In compile_saliency_function exchange your layer of interest. At last, take care of deprocessing.

Have fun

navraj432 commented 4 years ago

@jenskrauth @abhigoku10 i tried to implement Grad-CAM for my own model. i couldn't, i got errors. do you have any code so that i can take it as a reference

924175302 commented 4 years ago

@navraj432 @abhigoku10 Do you understand how the process is going?Grad-Cam for custom defined architecture