AeDet icon indicating copy to clipboard operation
AeDet copied to clipboard

ae_offset计算相关

Open qq1361096516 opened this issue 2 years ago • 3 comments

文件:AeDet-main\mmdetection3d\mmdet3d\ops\aeconv\aeconv.py 中 计算方位角偏差 ae_offset = torch.bmm(rot_matrix, conv_offset.transpose(1, 2)).transpose(1, 2) - conv_offset 想问下,最后的 - conv_offset 的含义是什么

qq1361096516 avatar Jan 04 '24 13:01 qq1361096516

'- conv_offset' is used for adapting to the 'deform_conv2d' function.

The 'deform_conv2d' function carries out the offset based on the sampling grid of the typical convolution. On the other hand, 'torch.bmm(rot_matrix, conv_offset.transpose(1, 2)).transpose(1, 2)' denotes the offset of AeConv based on the center point of the convolution. Thus, 'torch.bmm(rot_matrix, conv_offset.transpose(1, 2)).transpose(1, 2) - conv_offset' signifies the offset of AeConv based on the sampling grid of the typical convolution, which aligns with the 'deform_conv2d' function.

fcjian avatar Jan 08 '24 07:01 fcjian

感谢解答

qq1361096516 avatar Jan 17 '24 10:01 qq1361096516

文件:AeDet-main\mmdetection3d\mmdet3d\ops\aeconv\aeconv.py 中 def get_offset(self, size): # compute the rotation matrix of AeConv h, w = size out_h, out_w = h // self.stride[0], w // self.stride[1] 此处计算 out_h, out_w 和 https://pytorch.org/docs/stable/generated/torch.nn.Conv2d.html 中计算卷积的方法不太一样 image 某些情况下会导致两者计算出来的结果不一样,比如 h_in=7,kernel_size=3,stride=2,padding=1,dilation=1时两者不一样(一个计算出来是3,另一个计算出来是4)。

另外:想问下下方使用 shift_h 和 shift_w 的考虑是什么

align the sampled grid with the feature

shift_h = (h - self.weight.shape[2]) % self.stride[0] shift_w = (w - self.weight.shape[3]) % self.stride[1] ae_offset[:, :, 0] += shift_w / 2.0 ae_offset[:, :, 1] += shift_h / 2.0

qq1361096516 avatar Jan 17 '24 11:01 qq1361096516