py123d_detection.torch.data.boxes

A frame’s ground truth: 123D box detections as filtered ego-frame boxes.

Boxes are read before any image, because a frame left without boxes is rejected and decoding six or seven JPEGs to find that out is the expensive way round.

Module Attributes

BOX_COLUMNS

Columns of gt_bboxes_3d.

Classes

BoxFilters([...])

Which ground-truth boxes a frame contributes.

BoxLoader(source, scenes, taxonomy, filters, ...)

Reads, maps, filters and converts one frame's boxes.

Boxes(boxes, labels, class_names)

One frame's boxes, in the ego frame and not yet augmented.

py123d_detection.torch.data.boxes.BOX_COLUMNS = ('x', 'y', 'z', 'w', 'l', 'h', 'yaw', 'vx', 'vy')

Columns of gt_bboxes_3d.

class py123d_detection.torch.data.boxes.BoxFilters(drop_boxes_without_lidar_points=True, lidar_point_cache=None, drop_frames_without_boxes=True, pc_range=None, visibility=None, visibility_margin_deg=0.0)[source]

Bases: object

Which ground-truth boxes a frame contributes.

Every one of these removes annotations a camera-only model cannot be expected to find, so leaving them off does not make a benchmark harder, it makes it meaningless.

drop_boxes_without_lidar_points: bool = True

Drop boxes the log records as having zero lidar returns, i.e. fully occluded objects. A count of -1 means the dataset does not record one and is always kept.

lidar_point_cache: str | None = None

Take point counts from this cache instead, where it has them; see py123d_detection.core.lidar_points. Waymo’s 123D logs record no counts, so without it no Waymo box is ever dropped as unseen.

drop_frames_without_boxes: bool = True

Skip a frame left with no box at all, rather than training on an empty target.

pc_range: Tuple[float, float, float, float, float, float] | None = None

(x_min, y_min, z_min, x_max, y_max, z_max) in the ego frame. Boxes outside are dropped. The legacy implementation accepted the z bounds and applied only x and y.

visibility: str | None = None

"center" or "corners": drop boxes no camera of the rig could see. A rig covering the full circle makes this a no-op.

visibility_margin_deg: float = 0.0

Widen each camera’s field of view before testing, so an object on the edge is kept.

class py123d_detection.torch.data.boxes.Boxes(boxes, labels, class_names)[source]

Bases: object

One frame’s boxes, in the ego frame and not yet augmented.

boxes: ndarray

(M, 9) float64 rows of BOX_COLUMNS.

labels: ndarray

(M,) int64 indices into the taxonomy’s class names.

class_names: List[str]
class py123d_detection.torch.data.boxes.BoxLoader(source, scenes, taxonomy, filters, cameras, compute_velocity=False)[source]

Bases: object

Reads, maps, filters and converts one frame’s boxes.

Parameters:
  • source (Source) – Where the logs came from; velocities are derived from the same logs read at their native frame rate.

  • scenes (Sequence[Any]) – The resolved logs. The first one’s rig geometry defines camera visibility.

  • cameras (Sequence[str]) – The rig’s camera names, for the visibility filter.

  • compute_velocity (bool) – Derive velocity from track positions over time, for datasets that store none, such as Argoverse 2 and Waymo.

load(scene, iteration, world_to_ego)[source]
Return type:

Boxes