How to visualize the attention map on the input video?

#2
by mp31192 - opened

I use the example code to obtain the outputs and the attention map as follows:

ouputs = model(pixel_values, output_attentions=True)
attention_map = outputs["attentions"]

The shape of input (pixel_values) is [8, 3, 224, 224] and the attention_map contains twelve [8, 12, 51, 51] matrics. How can i visualize the attention map on the input video?

Sign up or log in to comment