cmsflash / efficient-attention

An implementation of the efficient attention module.
https://arxiv.org/abs/1812.01243
MIT License
272 stars 26 forks source link

Different query positions on the same image #3

Closed horanyinora closed 3 years ago

horanyinora commented 3 years ago

Hello, Thanks for the excellent work. I would like to show different attention maps produced using different query positions (reference bouding boxes). For example when there are three bouding boxes on the image I would like to calculate the attention w.r.t. them and show the difference. Is it possible to do this?
Screenshot from 2021-05-05 10-32-24

cmsflash commented 3 years ago

It is possible. You can simply multiply a specific query to the key feature map to get the query-specific weights for the entire image.