|
if prev_bev is not None: |
|
if prev_bev.shape[1] == bev_h * bev_w: |
|
prev_bev = prev_bev.permute(1, 0, 2) |
|
if self.rotate_prev_bev: |
|
for i in range(bs): |
|
# num_prev_bev = prev_bev.size(1) |
|
rotation_angle = kwargs['img_metas'][i]['can_bus'][-1] |
|
tmp_prev_bev = prev_bev[:, i].reshape( |
|
bev_h, bev_w, -1).permute(2, 0, 1) |
|
tmp_prev_bev = rotate(tmp_prev_bev, rotation_angle, |
|
center=self.rotate_center) |
|
tmp_prev_bev = tmp_prev_bev.permute(1, 2, 0).reshape( |
|
bev_h * bev_w, 1, -1) |
|
prev_bev[:, i] = tmp_prev_bev[:, 0] |
|
metas_map[i]['can_bus'][-1] -= prev_angle |
According to the codes above, the rotation_angle used to rotate prev_bev is the difference between two patch angles, which is now_angle - prev_angle.
However, as shown in the following figure, if we want to align prev_bev (in yellow color) to the current frame (in black color), we are actually rotate the black rectangle (prev_bev in the previous frame coordinate) to the yellow rectangle (prev_bev in the current frame coordinate).
So my question is, the rotation_angle used to rotate prev_bev should be prev_angle - now_angle, rather than now_angle - prev_angle used in the code above, is that right?

BEVFormer/projects/mmdet3d_plugin/bevformer/modules/transformer.py
Lines 143 to 156 in 66b65f3
BEVFormer/projects/mmdet3d_plugin/datasets/nuscenes_dataset.py
Line 78 in 66b65f3
According to the codes above, the
rotation_angleused to rotateprev_bevis the difference between two patch angles, which isnow_angle - prev_angle.However, as shown in the following figure, if we want to align
prev_bev(in yellow color) to the current frame (in black color), we are actually rotate the black rectangle (prev_bevin the previous frame coordinate) to the yellow rectangle (prev_bevin the current frame coordinate).So my question is, the
rotation_angleused to rotateprev_bevshould beprev_angle - now_angle, rather thannow_angle - prev_angleused in the code above, is that right?