Skip to content

Conversation

@kitamura-felipe
Copy link

This PR adds saliency3D.py, which implements a 3D version of visualize_cam().

Usage is described in example/3D_saliency_snippet.ipynb

A minor change in scipy/misc/pilutils.py is needed and is described in vis/visualization/follow_this.txt

@keisen
Copy link
Collaborator

keisen commented Aug 31, 2018

Thank you for the PR.

I don't think we should merge this change.
Because currently keras-vis (i.e., master branch) is able to visualize cam in 3-dims.

zoom_factor = [i / (j * 1.0) for i, j in iter(zip(input_dims, output_dims))]
heatmap = zoom(heatmap, zoom_factor)

@keisen keisen self-requested a review August 31, 2018 22:45
@kitamura-felipe
Copy link
Author

kitamura-felipe commented Aug 31, 2018 via email

@keisen
Copy link
Collaborator

keisen commented Sep 1, 2018

Can you show us the detail of minor bug ?

@kitamura-felipe
Copy link
Author

kitamura-felipe commented Sep 1, 2018 via email

@keisen
Copy link
Collaborator

keisen commented Sep 2, 2018

I don't have the error anymore, but if you run the code on a 3D model with
1 channel (batch_size, d1, d2, d3, channel=1), the error will appear.

I tried it but the error was not occurred.
The shape of input data is (batch_size, d1, d2, d3, 1) and the shape of visualize_cam result is (d1, d2, d3), It has no problem.

Can you post the short script (or the link of Gist) here that can reproduce your issue ?

visualize_cam_with_losses
folows:
[image: image.png]
[image: photo]

Please resend the images if you need.

@raghakot
Copy link
Owner

We should just fix the issue that causes his use-case to not work. The API should handle N-dim inputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants