Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grad-cam generation #7

Open
jpainam opened this issue Nov 13, 2022 · 4 comments
Open

grad-cam generation #7

jpainam opened this issue Nov 13, 2022 · 4 comments

Comments

@jpainam
Copy link

jpainam commented Nov 13, 2022

Hi,
Could you share the util functions you used to generate the grad cam?

Thanks.

@kylemin
Copy link
Member

kylemin commented Nov 14, 2022

Thank you for your interest.

We used the PyTorch version of Grad-CAM++: link. Please refer to this repository.
We also noticed that there is a well-maintained library for various types of CAMs that you can refer to: link2

Thank you,
Kyle

@jpainam
Copy link
Author

jpainam commented Nov 15, 2022

Thank you.
I was able to generate GradCAM for model_base using [https://github.com/1Konny/gradcam_plus_plus-pytorch](this link).
For model_gaze, register_backward_hook doesn't fire. But register_forward_hook does.
So, I don't have the gradients['value']

Is there any else I'm missing?

You have three submodel (model_base, model_gaze, model_attn), when you said you visualize the last convolutional layer
of our model. Which of the three models?

Thank you

@kylemin
Copy link
Member

kylemin commented Nov 15, 2022

You can visualize the output after the last conv layer (Mixed_5c) of model_base. You do not need to use register_backward_hook for model_gaze because you are expected to register the hooks only for model_base

@jpainam
Copy link
Author

jpainam commented Nov 16, 2022

Ok thank. you train three differents network, (I3D, I3D w/ gaze and I3D w/ gaze and attention).
You visualize the output of Mixed_5c for each network.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants