py123detection.mmcv_export.converter¶
123D scenes -> mmdetection3d info dicts, one per frame.
The reference frame is the keyframe’s lidar frame, as in mmdet3d. 123D stores everything in the
global frame, so each frame composes lidar -> ego -> global from the ego state and rig
extrinsics and inverts it. See py123detection.mmcv_export.schema for the fields.
Module Attributes
123D camera ids. |
Classes
|
Everything that shapes an export, independent of which scenes are exported. |
|
|
|
- py123detection.mmcv_export.converter.DEFAULT_CAMERA_ORDER: Tuple[str, ...] = ('PCAM_F0', 'PCAM_R0', 'PCAM_L0', 'PCAM_B0', 'PCAM_L1', 'PCAM_R1')¶
123D camera ids. On a nuScenes rig this is CAM_FRONT, CAM_FRONT_RIGHT, CAM_FRONT_LEFT, CAM_BACK, CAM_BACK_LEFT, CAM_BACK_RIGHT, the order mmdetection3d’s converter uses and pretrained multi-view models expect.
- class py123detection.mmcv_export.converter.ExportConfig(taxonomy=Taxonomy(name='nuscenes_detection_10cls'), camera_order=('PCAM_F0', 'PCAM_R0', 'PCAM_L0', 'PCAM_B0', 'PCAM_L1', 'PCAM_R1'), camera_key='native', reference_lidar=None, max_sweeps=10, with_2d_annotations=True, on_missing_camera='skip_frame', sensors=<factory>, token_resolver=<factory>, include_track_tokens=True, yaw_convention='mmdet3d', lidar2ego_mode='static', camera2ego_mode='static', lidar_frame='sensor', planar_velocity=True, box_layout='streampetr', velocity_source='stored', velocity_max_dt_s=0.25, ego_pose_source='sync')[source]¶
Bases:
objectEverything that shapes an export, independent of which scenes are exported.
- camera_order: Tuple[str, ...] = ('PCAM_F0', 'PCAM_R0', 'PCAM_L0', 'PCAM_B0', 'PCAM_L1', 'PCAM_R1')¶
123D
CameraIDnames, in model input order.
- camera_key: str = 'native'¶
Key of each camera in
info['cams']:"native"(CAM_FRONT, what stock configs expect) or"camera_id"(PCAM_F0, consistent across datasets in merged exports).
- reference_lidar: str | None = None¶
LidarIDname of the reference frame.NonepicksLIDAR_TOP, else the first lidar.
- max_sweeps: int = 10¶
Preceding lidar frames per info, taken at the log’s own rate rather than the export rate.
A keyframe-only nuScenes conversion only holds 2 Hz lidar, so its sweeps are 2 Hz. The first frame of a log always gets an empty list, which StreamPETR reads as a sequence start.
- on_missing_camera: str = 'skip_frame'¶
"skip_frame"(multi-view models need a fixed camera count),"drop_camera"or"error".
- sensors: SensorResolverConfig¶
- token_resolver: TokenResolver¶
- yaw_convention: str = 'mmdet3d'¶
"mmdet3d"matches pickles from mmdetection3d’s converter,"heading"the nuScenes devkit. Seepy123detection.geometry.mmdet3d_yaw().
- lidar2ego_mode: str = 'static'¶
"static"writes the rig extrinsic, like mmdetection3d’s converter."dynamic"also folds in the ego motion between the frame timestamp and the lidar’s own timestamp:inv(ego2global_at_frame) @ ego2global_at_lidar_time @ lidar2ego_static. 123D stores no per-row lidar pose, so this only differs from static when the ego stream is denser than the frames (not for keyframe-only nuScenes).
- camera2ego_mode: str = 'static'¶
Where a camera’s timing offset to the frame is booked.
"static"keepssensor2egoat the rig calibration and movesego2globalto the camera timestamp, like mmdetection3d."dynamic"keeps the frame’sego2globaland folds the offset intosensor2ego.sensor2lidar, which PETR and StreamPETR use, is the same either way; BEVDet-style configs read the two parts separately.
- lidar_frame: str = 'sensor'¶
"sensor"uses the reference lidar’s frame (mmdet3d’s convention, and the frame of a referenced point cloud file)."ego"uses the ego/IMU frame, solidar2egois the identity.
- planar_velocity: bool = True¶
Drop the global vertical velocity before rotating into the lidar frame. mmdetection3d does this and its evaluation assumes it.
- box_layout: str = 'streampetr'¶
gt_boxescolumn layout, seepy123detection.annotations.BOX_LAYOUTS. A wrong choice does not crash, it trains on transposed, mis-rotated boxes.
- velocity_source: str = 'stored'¶
"stored"uses the log’s velocity (zero if the dataset has none)."tracks"derives it from neighbouring annotations of each track, seepy123detection.velocity.
- ego_pose_source: str = 'sync'¶
Which ego state gives a frame’s
ego2global: the sync table row ("sync") or the state nearest to the frame timestamp ("nearest").The sync table takes the first ego row at or after the frame timestamp, so an ego timestamp that is 1 us early skips the right row. py123d 0.6.0’s Argoverse 2 parser round-trips the nanosecond stamps through float64: 5% of ego rows come back 1 us early and ~40% of frames get an ego pose 2-10 ms late (up to 9 cm).
"nearest"avoids that.
- class py123detection.mmcv_export.converter.ExportStats(num_logs=0, num_frames=0, num_boxes=0, frames_skipped_missing_camera=0, frames_skipped_missing_ego=0, frames_skipped_missing_lidar=0, logs_skipped=0, dynamic_extrinsic_fallbacks=0, boxes_without_track_velocity=0, ego_pose_fallbacks=0, ego_pose_max_offset_us=0, dropped_cameras=<factory>, class_counts=<factory>, num_referenced_payloads=0, num_extracted_payloads=0)[source]¶
Bases:
object
- class py123detection.mmcv_export.converter.MMDet3DConverter(config=None)[source]¶
Bases:
object- property stats: ExportStats¶
- convert_scenes(scenes, timestamp_offset_us=0, progress=True, native_scenes=None)[source]¶
Convert scenes (one per log) into a flat list of infos.