"...api/git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "9c357bda3f0982889d59f7053de38de0dc8038ef"
Unverified Commit 683ceafb authored by Ziyi Wu's avatar Ziyi Wu Committed by GitHub
Browse files

fix rotation hack (#633)

parent e39d1984
...@@ -176,8 +176,10 @@ def mono_cam_box2vis(cam_box): ...@@ -176,8 +176,10 @@ def mono_cam_box2vis(cam_box):
# change local yaw to global yaw for visualization # change local yaw to global yaw for visualization
# refer to https://github.com/open-mmlab/mmdetection3d/blob/master/mmdet3d/datasets/nuscenes_mono_dataset.py#L164-L166 # noqa # refer to https://github.com/open-mmlab/mmdetection3d/blob/master/mmdet3d/datasets/nuscenes_mono_dataset.py#L164-L166 # noqa
yaw += torch.atan2(loc[:, 0], loc[:, 2]) yaw += torch.atan2(loc[:, 0], loc[:, 2])
# convert yaw by (np.pi / 2 - yaw) # convert yaw by (-yaw - np.pi / 2)
yaw = np.pi / 2.0 - yaw # this is because mono 3D box class such as `NuScenesBox` has different
# definition of rotation with our `CameraInstance3DBoxes`
yaw = -yaw - np.pi / 2
cam_box = torch.cat([loc, dim, yaw[:, None], feats], dim=1) cam_box = torch.cat([loc, dim, yaw[:, None], feats], dim=1)
cam_box = CameraInstance3DBoxes( cam_box = CameraInstance3DBoxes(
cam_box, box_dim=cam_box.shape[-1], origin=(0.5, 0.5, 0.5)) cam_box, box_dim=cam_box.shape[-1], origin=(0.5, 0.5, 0.5))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment