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

The purpose of "grayscale_cam" and "weights_gradcam" in main.py #4

Open
demidovd98 opened this issue Jan 26, 2023 · 6 comments
Open

Comments

@demidovd98
Copy link

Hello,

Could you please explain what's the purpose of the "grayscale_cam" and "weights_gradcam" variables in main.py (line 148) ?

These variables are never used, but they are probably important since they come from the "cam_algorithm" function.
However, I haven't found any link to the variables in the code.

Is it a mistake, or is it supposed to be like this?

Thank you.

@demidovd98
Copy link
Author

Also, could you please check if the uploaded version of the code is the final one?
Seems like there are several bugs and typos, especially in the main.py and datasets preparation files.

Thank you.

@GANPerf
Copy link
Owner

GANPerf commented Jan 31, 2023

Hi guys, Thank you for your questions.
"weights_gradcam" is used for generated gradcam-based weights. You can see line 159. It is an alternative to using cam or gradcam weight. Some variable is never used because the current code runs in the cam case, while those variables are related to the gradcam case. Some others still need to change, e.g., CBP or BP to used. Details can see line 58-86 in method.py.Apologise for the inconvenience.
Also, I add some document declarations in datasets preparation files, e.g., line 29 ''train10'' in cub200.py. It may be some bugs when you run --label_ratio 10 if missing line 29 in dataset txt.
Following your attention, I also fix some typos and bugs. You can run again. Wish this will help you.

@demidovd98
Copy link
Author

demidovd98 commented Feb 2, 2023

Hi guys, Thank you for your questions. "weights_gradcam" is used for generated gradcam-based weights. You can see line 159. It is an alternative to using cam or gradcam weight. Some variable is never used because the current code runs in the cam case, while those variables are related to the gradcam case. Some others still need to change, e.g., CBP or BP to used. Details can see line 58-86 in method.py.Apologise for the inconvenience. Also, I add some document declarations in datasets preparation files, e.g., line 29 ''train10'' in cub200.py. It may be some bugs when you run --label_ratio 10 if missing line 29 in dataset txt. Following your attention, I also fix some typos and bugs. You can run again. Wish this will help you.

Thank you for the reply.
But why would it be just CAM in the default code?
Seems like the default method is GradCAM, and the performance is also reported for GradCAM.

Is it possible to adapt the code to use GradCAM by default?

@HashmatShadab
Copy link

Kindly update on the above questions. Proper documentation of how to run the experiments to reproduce the main experiments reported in the paper would be appreciated.

@GANPerf
Copy link
Owner

GANPerf commented May 24, 2023

Hi guys, Thank you for your questions. "weights_gradcam" is used for generated gradcam-based weights. You can see line 159. It is an alternative to using cam or gradcam weight. Some variable is never used because the current code runs in the cam case, while those variables are related to the gradcam case. Some others still need to change, e.g., CBP or BP to used. Details can see line 58-86 in method.py.Apologise for the inconvenience. Also, I add some document declarations in datasets preparation files, e.g., line 29 ''train10'' in cub200.py. It may be some bugs when you run --label_ratio 10 if missing line 29 in dataset txt. Following your attention, I also fix some typos and bugs. You can run again. Wish this will help you.

Thank you for the reply. But why would it be just CAM in the default code? Seems like the default method is GradCAM, and the performance is also reported for GradCAM.

Is it possible to adapt the code to use GradCAM by default?

Thank you for your question. I have now separated the file into two parts: src/main_bp_cam.py and src/main_bp_gradcam.py. Please take a look at them.

@GANPerf
Copy link
Owner

GANPerf commented May 24, 2023

Kindly update on the above questions. Proper documentation of how to run the experiments to reproduce the main experiments reported in the paper would be appreciated.

Thank you for your question. I have now separated the file into two parts: src/main_bp_cam.py and src/main_bp_gradcam.py. Please take a look at them.

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

3 participants