Git Product home page Git Product logo

centernet-grad-cam's Introduction

CenterNet Grad-CAM/++

Show cam for CenterNet, support task ctdet.

Thanks

https://github.com/xingyizhou/CenterNet
https://github.com/jinfagang/DCNv2_latest
https://github.com/yizt/Grad-CAM.pytorch

Prepare

  1. Install Pytorch 1.9
  2. git clone https://github.com/JasperMorrison/CenterNet -b grad_cam
  3. cd src/lib/models/networks/DCNv2/;rm DCNv2 -rf;
  4. git clone https://github.com/jinfagang/DCNv2_latest DCNv2
  5. cd DCNv2; vi make.sh; remove the sudo cmd prefix
  6. ./make.sh
  7. Download CenterNet pretrained model (refs to branch master);

Set hook layers

Add layer name to self.cam_layers in base_detector.py

    self.cam_layers = [
      # "conv1",
      # "layer1.0.conv1",
      # "layer2.0",
      # "layer3.0",
      "layer4.0",
      # "layer4.0.conv1",
      # "layer4.0.conv2",
      # "layer4.1",
      # "deconv_layers.15",
      # "hm.0", #set inplace=True as inplace=False in the model py
    ]

Example

  1. cd src
  2. python demo.py ctdet --demo ./images/ --load_model ./models/ctdet_coco_resdcn18.pth --arch resdcn_18 --grad_cam

centernet-grad-cam's People

Contributors

xingyizhou avatar cclauss avatar dequanwang avatar jscsmk avatar lbin avatar dannykuo25 avatar sirykd avatar gcaya avatar pjunhyuk avatar ridhwanluthra avatar chengzhengxin avatar jaspermorrison avatar xuannianz avatar sundrops avatar

Stargazers

 avatar Xinguang Dai avatar  avatar

Watchers

James Cloos avatar

Forkers

thucth-qt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.