py123d_detection.core.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
|
Combine riders with their vehicles, and drop what is left merge-only. |
|
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. |
- py123d_detection.core.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 py123d_detection.core.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 py123d_detection.core.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]¶
- py123d_detection.core.annotations.apply_merge_rules(records, taxonomy)[source]¶
Combine riders with their vehicles, and drop what is left merge-only.
Each secondary takes the free primary of the same rule it overlaps most, so a scene with two cyclists side by side pairs each rider with their own bicycle rather than both with one. Records not named by any rule pass through first and in order; merged ones follow.
- Return type:
- py123d_detection.core.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 (seepy123d_detection.core.velocity.TrackVelocityTable). Tracks not in it keep the stored velocity.- Return type:
- py123d_detection.core.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) – Seepy123d_detection.core.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: