Skip to content

Commit

Permalink
Fix 3D
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobgil committed Aug 18, 2024
1 parent 1610034 commit 7ff4d2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytorch_grad_cam/utils/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def scale_cam_image(cam, target_size=None):
img = img - np.min(img)
img = img / (1e-7 + np.max(img))
if target_size is not None:
if len(img.shape) > 3:
if len(img.shape) > 2:
img = zoom(np.float32(img), [
(t_s / i_s) for i_s, t_s in zip(img.shape, target_size[::-1])])
else:
Expand Down

0 comments on commit 7ff4d2e

Please sign in to comment.