Skip to content

Commit

Permalink
[Fix] Fix corner bug in different coordinates (#1212)
Browse files Browse the repository at this point in the history
* fix corner bug in cam coord

* fix corner bugs in depth & lidar coord
  • Loading branch information
wHao-Wu authored Feb 8, 2022
1 parent b4240bd commit c0d0090
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions mmdet3d/core/bbox/structures/cam_box3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ def corners(self):
v
down y
"""
# TODO: rotation_3d_in_axis function do not support
# empty tensor currently.
assert len(self.tensor) != 0
if self.tensor.numel() == 0:
return torch.empty([0, 8, 3], device=self.tensor.device)

dims = self.dims
corners_norm = torch.from_numpy(
np.stack(np.unravel_index(np.arange(8), [2] * 3), axis=1)).to(
Expand Down
6 changes: 3 additions & 3 deletions mmdet3d/core/bbox/structures/depth_box3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ def corners(self):
(x0, y0, z0) + ----------- + --------> right x
(x1, y0, z0)
"""
# TODO: rotation_3d_in_axis function do not support
# empty tensor currently.
assert len(self.tensor) != 0
if self.tensor.numel() == 0:
return torch.empty([0, 8, 3], device=self.tensor.device)

dims = self.dims
corners_norm = torch.from_numpy(
np.stack(np.unravel_index(np.arange(8), [2] * 3), axis=1)).to(
Expand Down
6 changes: 3 additions & 3 deletions mmdet3d/core/bbox/structures/lidar_box3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ def corners(self):
left y<-------- + ----------- + (x0, y1, z0)
(x0, y0, z0)
"""
# TODO: rotation_3d_in_axis function do not support
# empty tensor currently.
assert len(self.tensor) != 0
if self.tensor.numel() == 0:
return torch.empty([0, 8, 3], device=self.tensor.device)

dims = self.dims
corners_norm = torch.from_numpy(
np.stack(np.unravel_index(np.arange(8), [2] * 3), axis=1)).to(
Expand Down

0 comments on commit c0d0090

Please sign in to comment.