IDEA-Research / DINO

[ICLR 2023] Official implementation of the paper "DINO: DETR with Improved DeNoising Anchor Boxes for End-to-End Object Detection"
Apache License 2.0
2.15k stars 232 forks source link

Visualize the attentions of the model! #158

Open Hezey opened 1 year ago

Hezey commented 1 year ago

@HaoZhang534 @SlongLiu @FengLi-ust @IDEACVR Excuse me...Again, I have a question. How to Visualize the attentions of the model? 1.how to visualize encoder-decoder multi-head attention weights? 2.how to visualize encoder self-attention weights Thanks very much!

HaoZhang534 commented 1 year ago

@HaoZhang534 @SlongLiu @FengLi-ust @IDEACVR Excuse me...Again, I have a question. How to Visualize the attentions of the model? 1.how to visualize encoder-decoder multi-head attention weights? 2.how to visualize encoder self-attention weights Thanks very much!

You need to get the attention map you want and normalize it to 0~255 and then you can save it as an image.