fundamentalvision / Deformable-DETR

Deformable DETR: Deformable Transformers for End-to-End Object Detection.
Apache License 2.0
3.22k stars 520 forks source link

How to visulize the sampling points? #194

Open quxu91 opened 1 year ago

quxu91 commented 1 year ago

Thanks for your good job, I would like to visulize the sampling points in deformable attention, but i cannot get the right picture as your paper's fig6. I would greatly appreciate it if you could release your visulize code.

Lareix commented 1 year ago

Hello, have you implemented it? If possible, could you please provide me with the code? Thank you.

Minorant commented 8 months ago

I visualized it successfully, but is it normal for the same point to simply pan on a line between each query?

hwuidue commented 6 months ago

I visualized it successfully, but is it normal for the same point to simply pan on a line between each query?

您好 能请教一下您是怎么实现的吗 ?或者能提供一些思路给我吗 感谢大佬

Minorant commented 6 months ago

I visualized it successfully, but is it normal for the same point to simply pan on a line between each query?

您好 能请教一下您是怎么实现的吗 ?或者能提供一些思路给我吗 感谢大佬

简单来说就是取reference_points为中心点(对应fig6中的绿十字),sampling_locations为偏移后的点(对应fig6偏移点位置),attention_weights为偏移点的权值(对应fig6偏移点的颜色深浅) https://github.com/fundamentalvision/Deformable-DETR/blob/11169a60c33333af00a4849f1808023eba96a931/models/ops/modules/ms_deform_attn.py#L113