Open qq1361096516 opened 9 months ago
'- 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.
感谢解答
文件:AeDet-main\mmdetection3d\mmdet3d\ops\aeconv\aeconv.py 中 def get_offset(self, size):
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 中计算卷积的方法不太一样 某些情况下会导致两者计算出来的结果不一样,比如 h_in=7,kernel_size=3,stride=2,padding=1,dilation=1时两者不一样(一个计算出来是3,另一个计算出来是4)。
另外:想问下下方使用 shift_h 和 shift_w 的考虑是什么
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
文件: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
的含义是什么