Skip to content

This is a simple demo to demonstrate how to perfrom GradCAM on the detectron2 models and it's API

Notifications You must be signed in to change notification settings

alexriedel1/detectron2-GradCAM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

detectron2-GradCAM

This repo helps you to perform GradCAM and GradCAM++ on the detectron2 model zoo. It follows other GradCAM implementations but also handles the detectron2 API specific model details. Be sure to have the latest detectron2 version installed.

There is also this repo to do GradCAM in detectron2. It advises you to make changes to the detectron2 build which I think is not a good idea..

Original GradCAM (horse) GradCAM++ (horse)
drawing drawing drawing

For doing this, check the main.py and change the img_path, the config_file and the model_file according to your needs.

For ResNet50 models the layer backbone.bottom_up.res5.2.conv3 will be a good choice for the classification explanation. For larger or smaller models, change the layer accordingly via layer_name.

For your custom models, either write your own config.yaml or edit cfg_list

There's also a Colab with everything set up: GradCam Detecteron2

About

This is a simple demo to demonstrate how to perfrom GradCAM on the detectron2 models and it's API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages