Git Product home page Git Product logo

Comments (10)

NymnW avatar NymnW commented on May 21, 2024

Hi, I'd like to know this as well! Did you ever figure it out?

from pytorch-grad-cam.

lao-ling-jie avatar lao-ling-jie commented on May 21, 2024

Hi, I'd like to know this as well! Did you ever figure it out?

No, I give up

from pytorch-grad-cam.

MaxwellHogan avatar MaxwellHogan commented on May 21, 2024

@lao-ling-jie can you link source? just trying to better understand what you mean

from pytorch-grad-cam.

lao-ling-jie avatar lao-ling-jie commented on May 21, 2024

@lao-ling-jie can you link source? just trying to better understand what you mean

Thank you very much. For example, the feature map of last resnet block in Resnet50 is 204877 (for input image of 224*224). I want to visualize the first channel of this feature map. How to operate ?

from pytorch-grad-cam.

MaxwellHogan avatar MaxwellHogan commented on May 21, 2024

so by channel are you talking the RGB

from pytorch-grad-cam.

lao-ling-jie avatar lao-ling-jie commented on May 21, 2024

No,it's a specific channel of feature map

from pytorch-grad-cam.

MaxwellHogan avatar MaxwellHogan commented on May 21, 2024

I think I did what you were looking for if I am understanding it correctly - the for loop in line 117 is creating the merged feature map,

therefore the first channel can be accessed here using the following line:

        firstcam = weights[1] * target[1, :, :]

        for i, w in enumerate(weights):
            cam += w * target[i, :, :]

I have zipped my code and you can Ctrl+F firstcam to see what I have done elsewhere in the doc
firstcam

gradcam_v1.zip

from pytorch-grad-cam.

lao-ling-jie avatar lao-ling-jie commented on May 21, 2024

Thank you so much. I will verify it later.

from pytorch-grad-cam.

MaxwellHogan avatar MaxwellHogan commented on May 21, 2024

@lao-ling-jie verified?

from pytorch-grad-cam.

lao-ling-jie avatar lao-ling-jie commented on May 21, 2024

@lao-ling-jie verified?

I got the corresponding heat map,and think it works.

from pytorch-grad-cam.

Related Issues (20)

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.