wofmanaf / group-cam Goto Github PK
View Code? Open in Web Editor NEWCode for paper: Group-CAM: Group Score-Weighted Visual Explanations for Deep Convolutional Networks
License: Apache License 2.0
Code for paper: Group-CAM: Group Score-Weighted Visual Explanations for Deep Convolutional Networks
License: Apache License 2.0
Hi, thanks for sharing your code that is very useful. I just have a simple question. In the paper, you said you the number of replaced pixels is 224 x 8, but in your code, it is 224 x 2. Which one do you recommend for experiments? In the previous papers, it is around one per cent that is close to 224 x 2. What is your reason that you choose 3.6%? Thanks.
目前demo中有resnet50和vgg19两个可视化操作,请问rest的操作是怎样的,谢谢
Hi, I found out the results of GradCAM and GroupCAM are the same for resnet50. Could you offer some explanations? Thanks.
I use your groupcam code, but I get the NoneType
Here is my code:
def cam(model, loader, target_layer='conv1'):
gc = GroupCAM(model, target_layer=target_layer)
for i, (data, target) in enumerate(loader):
if torch.cuda.is_available():
data = data.cuda(non_blocking=True)
target = target.cuda(non_blocking=True)
saliency_maps = []
model.eval()
for idx in range(data.shape[0]):
image = data[idx].unsqueeze(0)
if idx == data.shape[0] - 1:
saliency = gc(image, class_idx=target[idx], retain_graph=False)
else:
saliency = gc(image, class_idx=target[idx], retain_graph=True)
saliency = saliency.to(device)
saliency_maps.append(saliency)
saliency_maps = torch.cat(saliency_maps, dim=0)
mean = torch.mean(saliency_maps)
saliency_maps = torch.where(saliency_maps < mean, 0.0, 1.0)
The model is my DNN, and the loader is the CIFAR-10 eval_loader,
My PyTorch version: '1.12.1+cu116'
Python version: 3.7
Hi,
I have seen your paper and you have done a splendid job on the class activation maps generating algorithm. Also, you have uploaded your codes for the sanity check, deletion and insertion, as well as finetuning the classification network. I am wondering it would be very kind of you to upload your codes for the localization evaluation, too. So, is that uploading possible?
Thanks,
Ema1997.
我看到这篇论文在推送中说被收录到CVPR2021,但是我去谷歌上搜索没看到被收录
when debugging line 44 in groupcam.py, it happens Exception has occurred: KeyError
'value'
self.gradients.items is <built-in method items of dict object at 0x7f62f854ad80>
Is there a problem there?
thanks
when i run the demo : python3 demo.py --arch vgg19 --target_layer features.36 --input images/ILSVRC2012_val_00043392.JPEG --output base.png
~/work/Group-CAM$ python3 demo.py --arch vgg19 --target_layer features.36 --input images/ILSVRC2012_val_00043392.JPEG --output base.png
/.local/lib/python3.6/site-packages/kornia/augmentation/augmentation.py:1833: DeprecationWarning: GaussianBlur is no longer maintained and will be removed from the future versions. Please use RandomGaussianBlur instead. category=DeprecationWarning,
Thank you!
I got some confusion about the code in main.py line 315.images = images * saliency_maps + blur(images) + (1-saliency_maps)
.
What do you mean to plus the (1 - saliency_maps) here? And what's the size of the saliency_maps here?
Is there any possible to share newest code of visualization such as Guided Integrated Gradients?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.