Open zuo-ux opened 3 years ago
Below are the related code. https://github.com/Windaway/Deformable-Attention-for-Deformable-DETR/blob/main/DFMAtt.py
You can get sampling point and attention weight here:
and if you want normalized coordinate (range in [0, 1]) of sampling points, get sampling_locations after L111
Thanks!Can you leave your WeChat? I have a few questions to consult you.
I cannot visualize it yet. I plotted the sampling points in here https://github.com/duongnv0499/Explain-Deformable-DETR/blob/master/abcd.png but it seems to be wrong. Im on the way to fix it.
Okay, I am currently applying deformable attention to semantic segmentation, and the code has run successfully.
I cannot visualize it yet. I plotted the sampling points in here https://github.com/duongnv0499/Explain-Deformable-DETR/blob/master/abcd.png but it seems to be wrong. Im on the way to fix it.
Hi, is there a working visualization code for the deformable DETR by any chance? Thanks!
I cannot visualize it yet. I plotted the sampling points in here https://github.com/duongnv0499/Explain-Deformable-DETR/blob/master/abcd.png but it seems to be wrong. Im on the way to fix it.
Hi, any success? Thanks
I cannot visualize it yet. I plotted the sampling points in here https://github.com/duongnv0499/Explain-Deformable-DETR/blob/master/abcd.png but it seems to be wrong. Im on the way to fix it.
Hi, have you success?
I cannot visualize it yet. I plotted the sampling points in here https://github.com/duongnv0499/Explain-Deformable-DETR/blob/master/abcd.png but it seems to be wrong. Im on the way to fix it.
Hi, have you success?
Not yet.
I cannot visualize it yet. I plotted the sampling points in here https://github.com/duongnv0499/Explain-Deformable-DETR/blob/master/abcd.png but it seems to be wrong. Im on the way to fix it.
Hi, have you success?
Not yet.
Do you have the code of the picture generated above mentioned?
@quxu91 @sharat29ag @yairkit Regarding Figure 5 and Figure 6 in the paper, have you had a successful code visualization?
@quxu91 @sharat29ag @yairkit Regarding Figure 5 and Figure 6 in the paper, have you had a successful code visualization?
hey bro ,have you success? thank you very much!
How to get the sampling points? Below are the related code.
import torch import torch.nn as nn import torch.nn.functional as F
M=1 K=*
class DFMAtt(nn.Module): def init(self, in_ch,out_ch, k): super().init() self.conv = nn.Conv2d(in_ch, out_ch, 1, 1, 0,bias=True) self.k=k self.out_ch=out_ch offset_list=[] for x in range(k): conv = nn.Conv2d(in_ch, 2, 1, 1, 0,bias=True) offset_list.append(conv) self.offset_conv=nn.ModuleList(offset_list) self.weight_conv= nn.Sequential(nn.Conv2d(in_ch, k, 1, 1, 0,bias=True),nn.Softmax(1))