Skip to content

Commit

Permalink
fix merge, lower gif size
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobgil committed May 28, 2024
1 parent 3f6b14d commit b9f477e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Binary file modified examples/multiorgan_segmentation.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions pytorch_grad_cam/utils/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,11 @@ 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:
img = zoom(np.float32(img), [(t_s/i_s) for i_s, t_s in zip(img.shape, target_size[::-1])])
else:
img = cv2.resize(np.float32(img), target_size)
if len(img.shape) > 3:
img = zoom(np.float32(img), [
(t_s / i_s) for i_s, t_s in zip(img.shape, target_size[::-1])])
else:
img = cv2.resize(np.float32(img), target_size)

result.append(img)
result = np.float32(result)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name='grad-cam',
version='1.5.0',
version='1.5.2',
author='Jacob Gildenblat',
author_email='jacob.gildenblat@gmail.com',
description='Many Class Activation Map methods implemented in Pytorch for classification, segmentation, object detection and more',
Expand Down

0 comments on commit b9f477e

Please sign in to comment.