Skip to content

Commit

Permalink
fix idx
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoubolei committed May 2, 2018
1 parent 611e164 commit 6cf5ffb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytorch_CAM.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def returnCAM(feature_conv, weight_softmax, class_idx):
bz, nc, h, w = feature_conv.shape
output_cam = []
for idx in class_idx:
cam = weight_softmax[class_idx].dot(feature_conv.reshape((nc, h*w)))
cam = weight_softmax[idx].dot(feature_conv.reshape((nc, h*w)))
cam = cam.reshape(h, w)
cam = cam - np.min(cam)
cam_img = cam / np.max(cam)
Expand Down

0 comments on commit 6cf5ffb

Please sign in to comment.