Skip to content

Commit

Permalink
Fix docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
yezhen17 committed Jul 21, 2021
1 parent 64abd61 commit e14e9c5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
10 changes: 6 additions & 4 deletions mmdet3d/core/bbox/structures/box_3d_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def convert(box, src, dst, rt_mat=None, with_yaw=True):
Args:
box (tuple | list | np.ndarray |
torch.Tensor | BaseInstance3DBoxes):
torch.Tensor | :obj:`BaseInstance3DBoxes`):
Can be a k-tuple, k-list or an Nxk array/tensor, where k = 7.
src (:obj:`Box3DMode`): The src Box mode.
dst (:obj:`Box3DMode`): The target Box mode.
Expand All @@ -75,11 +75,13 @@ def convert(box, src, dst, rt_mat=None, with_yaw=True):
The conversion from `src` coordinates to `dst` coordinates
usually comes along the change of sensors, e.g., from camera
to LiDAR. This requires a transformation matrix.
with_yaw (bool): If `box` is an instance of `BaseInstance3DBoxes`,
whether or not it has a yaw angle. Defaults to True.
with_yaw (bool): If `box` is an instance of
:obj:`BaseInstance3DBoxes`, whether or not it has a yaw angle.
Defaults to True.
Returns:
(tuple | list | np.ndarray | torch.Tensor | BaseInstance3DBoxes):
(tuple | list | np.ndarray | torch.Tensor |
:obj:`BaseInstance3DBoxes`):
The converted box of the same type.
"""
if src == dst:
Expand Down
28 changes: 16 additions & 12 deletions mmdet3d/core/bbox/structures/coord_3d_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def convert(input, src, dst, rt_mat=None, with_yaw=True, is_point=True):
Args:
input (tuple | list | np.ndarray | torch.Tensor |
BaseInstance3DBoxes | BasePoints):
:obj:`BaseInstance3DBoxes` | :obj:`BasePoints`):
Can be a k-tuple, k-list or an Nxk array/tensor, where k = 7.
src (:obj:`Box3DMode` | :obj:`Coord3DMode`): The source mode.
dst (:obj:`Box3DMode` | :obj:`Coord3DMode`): The target mode.
Expand All @@ -74,15 +74,17 @@ def convert(input, src, dst, rt_mat=None, with_yaw=True, is_point=True):
The conversion from `src` coordinates to `dst` coordinates
usually comes along the change of sensors, e.g., from camera
to LiDAR. This requires a transformation matrix.
with_yaw (bool): If `box` is an instance of `BaseInstance3DBoxes`,
whether or not it has a yaw angle. Defaults to True.
with_yaw (bool): If `box` is an instance of
:obj:`BaseInstance3DBoxes`, whether or not it has a yaw angle.
Defaults to True.
is_point (bool): If `input` is neither an instance of
`BaseInstance3DBoxes` nor an instance of `BasePoints`,
whether or not it is point data. Defaults to True.
:obj:`BaseInstance3DBoxes` nor an instance of
:obj:`BasePoints`, whether or not it is point data.
Defaults to True.
Returns:
(tuple | list | np.ndarray | torch.Tensor |
BaseInstance3DBoxes | BasePoints):
:obj:`BaseInstance3DBoxes` | :obj:`BasePoints`):
The converted box of the same type.
"""
if isinstance(input, BaseInstance3DBoxes):
Expand All @@ -106,7 +108,7 @@ def convert_box(box, src, dst, rt_mat=None, with_yaw=True):
Args:
box (tuple | list | np.ndarray |
torch.Tensor | BaseInstance3DBoxes):
torch.Tensor | :obj:`BaseInstance3DBoxes`):
Can be a k-tuple, k-list or an Nxk array/tensor, where k = 7.
src (:obj:`Box3DMode`): The src Box mode.
dst (:obj:`Box3DMode`): The target Box mode.
Expand All @@ -115,11 +117,13 @@ def convert_box(box, src, dst, rt_mat=None, with_yaw=True):
The conversion from `src` coordinates to `dst` coordinates
usually comes along the change of sensors, e.g., from camera
to LiDAR. This requires a transformation matrix.
with_yaw (bool): If `box` is an instance of `BaseInstance3DBoxes`,
whether or not it has a yaw angle. Defaults to True.
with_yaw (bool): If `box` is an instance of
:obj:`BaseInstance3DBoxes`, whether or not it has a yaw angle.
Defaults to True.
Returns:
(tuple | list | np.ndarray | torch.Tensor | BaseInstance3DBoxes):
(tuple | list | np.ndarray | torch.Tensor |
:obj:`BaseInstance3DBoxes`):
The converted box of the same type.
"""
return Box3DMode.convert(box, src, dst, rt_mat=rt_mat)
Expand All @@ -130,7 +134,7 @@ def convert_point(point, src, dst, rt_mat=None):
Args:
point (tuple | list | np.ndarray |
torch.Tensor | BasePoints):
torch.Tensor | :obj:`BasePoints`):
Can be a k-tuple, k-list or an Nxk array/tensor.
src (:obj:`CoordMode`): The src Point mode.
dst (:obj:`CoordMode`): The target Point mode.
Expand All @@ -141,7 +145,7 @@ def convert_point(point, src, dst, rt_mat=None):
to LiDAR. This requires a transformation matrix.
Returns:
(tuple | list | np.ndarray | torch.Tensor | BasePoints):
(tuple | list | np.ndarray | torch.Tensor | :obj:`BasePoints`):
The converted point of the same type.
"""
if src == dst:
Expand Down

0 comments on commit e14e9c5

Please sign in to comment.