py123detection.annotations¶
Per-frame 3D annotations in mmdetection3d’s nuScenes layout.
123D stores boxes in the global frame, mmdet3d wants them in the keyframe’s lidar frame:
gt_boxes (N, 7) as [x, y, z, l, w, h, yaw] around the box center (mmdet3d moves the
origin to the bottom face at load time) and gt_velocity (N, 2).
Module Attributes
"streampetr": [x, y, z, l, w, h, yaw], written and read by StreamPETR and mmdetection3d >= 1.0. |
Functions
|
Move global-frame records into the lidar frame and build the mmdet3d arrays. |
|
Map 123D detections onto taxonomy classes, dropping unmapped ones. |
Classes
|
One annotated object, in the global frame. |
|
The 3D annotation block of one info, in the lidar frame. |
- py123detection.annotations.BOX_LAYOUTS = ('streampetr', 'mmdet3d_0.17')¶
“streampetr”: [x, y, z, l, w, h, yaw], written and read by StreamPETR and mmdetection3d >= 1.0. “mmdet3d_0.17”: [x, y, z, w, l, h, -yaw - pi/2], written by mmdetection3d 0.17’s nuScenes converter and fed verbatim into LiDARInstance3DBoxes by its dataset (PETR v1 pins 0.17).
- class py123detection.annotations.DetectionRecord(class_name, label_id, center_global, rotation_global, size_lwh, velocity_global, num_lidar_points, track_token, corners_global)[source]¶
Bases:
objectOne annotated object, in the global frame.
- class py123detection.annotations.FrameAnnotations(gt_boxes, gt_names, gt_velocity, num_lidar_pts, num_radar_pts, valid_flag, track_tokens, records)[source]¶
Bases:
objectThe 3D annotation block of one info, in the lidar frame.
- records: List[DetectionRecord]¶
- py123detection.annotations.extract_detection_records(detections, taxonomy, velocity_overrides=None)[source]¶
Map 123D detections onto taxonomy classes, dropping unmapped ones.
- Parameters:
velocity_overrides (
Optional[Mapping[str,ndarray]]) – Global-frame velocities by track token (seepy123detection.velocity.TrackVelocityTable). Tracks not in it keep the stored velocity.- Return type:
- py123detection.annotations.build_frame_annotations(records, global_to_lidar, yaw_convention='mmdet3d', planar_velocity=True, box_layout='streampetr')[source]¶
Move global-frame records into the lidar frame and build the mmdet3d arrays.
- Parameters:
yaw_convention (
str) – Seepy123detection.geometry.YAW_CONVENTIONS.planar_velocity (
bool) – Zero the vertical velocity before rotating, as mmdetection3d does. Otherwise a tilted lidar leaks it into(vx, vy).box_layout (
str) – One ofBOX_LAYOUTS.
- Return type: