py123detection.mmcv_export.annotations2d

Per-camera 2D / mono-3D annotations, which StreamPETR’s dataset reads during training.

This mirrors get_2d_boxes in mmdetection3d’s nuScenes converter: move each box into the camera frame with that camera’s own pose, project the corners and intersect their hull with the image. Two differences follow from what 123D stores: visibilities are empty strings (123D has no nuScenes visibility bins), and distorted cameras project through 123D’s camera model instead of a bare pinhole matrix.

Functions

project_records_to_camera(records, ...[, ...])

Project a frame's global-frame records into one camera.

Classes

Camera2DAnnotations([bboxes2d, labels2d, ...])

2D / mono-3D annotation arrays of one camera at one frame.

class py123detection.mmcv_export.annotations2d.Camera2DAnnotations(bboxes2d=<factory>, labels2d=<factory>, centers2d=<factory>, depths=<factory>, bboxes3d_cam=<factory>, bboxes_ignore=<factory>, visibilities=<factory>)[source]

Bases: object

2D / mono-3D annotation arrays of one camera at one frame.

bboxes2d: ndarray
labels2d: ndarray
centers2d: ndarray
depths: ndarray
bboxes3d_cam: ndarray
bboxes_ignore: ndarray
visibilities: List[str]
py123detection.mmcv_export.annotations2d.project_records_to_camera(records, camera_metadata, camera_to_global, yaw_convention='mmdet3d')[source]

Project a frame’s global-frame records into one camera.

Parameters:
  • camera_to_global (ndarray) – (4, 4) camera pose at the camera’s own timestamp.

  • yaw_convention (str) – Yaw read-out for bboxes3d_cam. The conventions differ a lot here, because a box seen from a camera frame carries a large roll/pitch.

Return type:

Camera2DAnnotations