Skip to content

How to overlay 3D cam heatmap on the 3D image and visualize it slice by slice? #127

Answered by frgfm
guyucowboy asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @guyucowboy 👋

My apologies for the late reply!
This is a very interesting question, I'll try to answer as best as I can:

  • beforehand, I have to say: I'm not a data visualization expert so don't take my opinion for the everlasting truth
  • common image related-visualization leverage 2 spatial dimensions and colors to "render" the values: in the case of a CAM of an image, the CAM ends up with values in the range [0, 1] across 2 spatial dimensions. So we use colors to map the values to a meaningful palet and that's the magic
import torch
import matplotlib.pyplot as plt

# Let's take a random cam
cam_2d = torch.rand((32, 32))
# Matplotlib will automatically select a colormap to render the…

Replies: 5 comments 14 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by frgfm
Comment options

You must be logged in to vote
1 reply
@frgfm
Comment options

Comment options

You must be logged in to vote
1 reply
@frgfm
Comment options

Comment options

You must be logged in to vote
6 replies
@Ljiaqii
Comment options

@frgfm
Comment options

@Ljiaqii
Comment options

@frgfm
Comment options

@Ljiaqii
Comment options

Comment options

You must be logged in to vote
6 replies
@Ljiaqii
Comment options

@frgfm
Comment options

@Ljiaqii
Comment options

@frgfm
Comment options

@Ljiaqii
Comment options

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