pytorch-grad-cam icon indicating copy to clipboard operation
pytorch-grad-cam copied to clipboard

Generate Heatmap for each object one by one

Open niclastrelle opened this issue 3 years ago • 1 comments

Hi,

is it somehow possible to generate the heatmap for each instance of one class seperately?

If I have the class cats and an image with 3 cats in it, I would like to gererate 3 seperate heatmaps for each cat. Can this even be achieved?

Thanks in advance

niclastrelle avatar Sep 16 '22 11:09 niclastrelle

Let's see. Can you assume the heatmaps of the 3 cats don't overlap with each other?

If we can assume that, we could just find the global heatmap for the cat category, and then separate it into connected components, and zero out the rest of the components in the heatmap of each of the cats.

Will the heatmaps spatially overlap ?

Can you share an example image ?

jacobgil avatar Sep 16 '22 16:09 jacobgil