Skip to content

Commit

Permalink
Merge pull request #247 from johnwlambert/patch-2
Browse files Browse the repository at this point in the history
improve docstrings in ObjectLabelRecord
  • Loading branch information
benjaminrwilson authored Jun 28, 2021
2 parents c0fb51b + 28528f5 commit c16f08e
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions argoverse/data_loading/object_label_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@


class ObjectLabelRecord:
"""Parameterizes an object via a 3d bounding box and its pose within the egovehicle's reference frame.
We refer to the object's pose as `egovehicle_SE3_object` and is parameterized by (R,t), where R is
a quaternion in scalar-first order.
"""

def __init__(
self,
quaternion: np.ndarray,
Expand All @@ -52,7 +58,7 @@ def __init__(
"""Create an ObjectLabelRecord.
Args:
quaternion: Numpy vector representing quaternion, box/cuboid orientation
quaternion: Numpy vector representing quaternion (qw,qx,qy,qz), box/cuboid orientation.
translation: Numpy vector representing translation, center of box given as x, y, z.
length: object length.
width: object width.
Expand All @@ -72,7 +78,7 @@ def __init__(
self.score = score

def as_2d_bbox(self) -> np.ndarray:
"""Construct a 2D bounding box from this label.
"""Convert the object cuboid to a 2D bounding box, with vertices provided in the egovehicle's reference frame.
Length is x, width is y, and z is height
Expand All @@ -97,10 +103,7 @@ def as_2d_bbox(self) -> np.ndarray:
return bbox_in_egovehicle_frame

def as_3d_bbox(self) -> np.ndarray:
r"""Calculate the 8 bounding box corners.
Args:
None
r"""Calculate the 8 bounding box corners (returned as points inside the egovehicle's frame).
Returns:
Numpy array of shape (8,3)
Expand Down Expand Up @@ -147,7 +150,7 @@ def render_clip_frustum_cv2(
) -> np.ndarray:
r"""We bring the 3D points into each camera, and do the clipping there.
Renders box using OpenCV2. Roughly based on
Renders box using OpenCV2. Edge coloring and vertex ordering is roughly based on
https://github.com/nutonomy/nuscenes-devkit/blob/master/python-sdk/nuscenes_utils/data_classes.py
::
Expand Down

0 comments on commit c16f08e

Please sign in to comment.