Skip to content

Commit 1610034

Browse files
committed
Merge branch 'master' of https://github.com/jacobgil/pytorch-grad-cam into master
2 parents 5636a52 + 603ec6c commit 1610034

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ You need to choose the target layer to compute CAM for.
101101
Some common choices are:
102102
- FasterRCNN: model.backbone
103103
- Resnet18 and 50: model.layer4[-1]
104-
- VGG and densenet161: model.features[-1]
104+
- VGG, densenet161 and mobilenet: model.features[-1]
105105
- mnasnet1_0: model.layers[-1]
106106
- ViT: model.blocks[-1].norm1
107107
- SwinT: model.layers[-1].blocks[-1].norm1
@@ -171,7 +171,7 @@ cam_metric = ROADMostRelevantFirst(percentile=75)
171171
scores, perturbation_visualizations = cam_metric(input_tensor,
172172
grayscale_cams, targets, model, return_visualization=True)
173173

174-
# You can also average accross different percentiles, and combine
174+
# You can also average across different percentiles, and combine
175175
# (LeastRelevantFirst - MostRelevantFirst) / 2
176176
from pytorch_grad_cam.metrics.road import ROADMostRelevantFirstAverage,
177177
ROADLeastRelevantFirstAverage,

usage_examples/swinT_example.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,11 @@ def reshape_transform(tensor, height=7, width=7):
9797
if args.method == "ablationcam":
9898
cam = methods[args.method](model=model,
9999
target_layers=target_layers,
100-
use_cuda=args.use_cuda,
101100
reshape_transform=reshape_transform,
102101
ablation_layer=AblationLayerVit())
103102
else:
104103
cam = methods[args.method](model=model,
105104
target_layers=target_layers,
106-
use_cuda=args.use_cuda,
107105
reshape_transform=reshape_transform)
108106

109107
rgb_img = cv2.imread(args.image_path, 1)[:, :, ::-1]

0 commit comments

Comments
 (0)