Closed WAMAWAMA closed 4 years ago
OK, I find the reason, though it's so weird. The package which I downloaded by pip install Keras-vis
in Windows10 is different from the one on GitHub.
suchlike the following:
the vis\visualization\saliency.py download by pip install Keras-vis
in Windows10
# ReLU thresholding to exclude pattern mismatch information (negative gradients).
heatmap = np.maximum(heatmap, 0)
# The penultimate feature map size is definitely smaller than input image.
input_dims = utils.get_img_shape(input_tensor)[2:]
heatmap = imresize(heatmap, input_dims, interp='bicubic', mode='F')
# Normalize and create heatmap.
heatmap = utils.normalize(heatmap)
return np.uint8(cm.jet(heatmap)[..., :3] * 255)
the vis\visualization\saliency.py one on GitHub.
# ReLU thresholding to exclude pattern mismatch information (negative gradients).
heatmap = np.maximum(heatmap, 0)
# The penultimate feature map size is definitely smaller than input image.
input_dims = utils.get_img_shape(input_tensor)[2:]
# Figure out the zoom factor.
zoom_factor = [i / (j * 1.0) for i, j in iter(zip(input_dims, output_dims))]
heatmap = zoom(heatmap, zoom_factor)
return utils.normalize(heatmap)
its easy to find the difference.
Hi, @WAMAWAMA . Thank you for reporting the problem and solution!
We'll close this issue because you've already done and there are some issues regarding the same problem (Such as #198 ). But please feel free to reopen this issue whenever you need.
Thanks!