py123d_detection.core.visibility¶
Which ground-truth boxes a rig’s cameras can actually see.
A camera-only detector is scored on every annotated object, including the ones behind it. On a 360-degree rig like nuScenes’ that is harmless. On Waymo’s five forward-facing cameras, which between them cover about 230 degrees, roughly a third of the annotations are objects no camera observed. Counting those makes recall look worse than the model is, for reasons that have nothing to do with the model.
RigVisibility reads the rig geometry once and then answers, per box, whether any camera
could have seen it. Two tests, in increasing cost:
centercompares the box centre’s bearing against each camera’s horizontal field of view. It ignores elevation and image bounds, and is a good default.cornersprojects all eight corners and asks whether any lands inside an image, so it accounts for both.
Neither test contains the other, so changing mode can drop boxes as well as add them. corners
is stricter about elevation and image bounds: a box directly overhead is within bearing but projects
off the top of the image. center is stricter at the horizontal edge, where a box whose centre
has left the field of view can still have corners imaged. Prefer corners when the vertical field
of view is narrow enough that bearing alone overcounts.
A rig covering the full circle short-circuits: every box is visible, and the filter costs nothing.
Module Attributes
Coverage at or above this counts as the full circle, in degrees. |
|
Minimum depth for a corner to be in front of a camera, in metres. |
Functions
|
Total angle the cameras cover between them, counting overlap once. |
|
Read a rig's geometry from one frame. |
Classes
|
One camera's placement and optics, in the ego frame. |
|
Where a rig's cameras point, and whether they leave any gap. |
- py123d_detection.core.visibility.FULL_COVERAGE_DEG = 355.0¶
Coverage at or above this counts as the full circle, in degrees. Slightly under 360 because rigs are built to overlap, not to tile exactly.
- py123d_detection.core.visibility.MIN_DEPTH_M = 0.1¶
Minimum depth for a corner to be in front of a camera, in metres.
- class py123d_detection.core.visibility.CameraView(name, bearing, half_fov, ego_to_camera, intrinsics, width, height)[source]¶
Bases:
objectOne camera’s placement and optics, in the ego frame.
- class py123d_detection.core.visibility.RigVisibility(views, coverage_deg)[source]¶
Bases:
objectWhere a rig’s cameras point, and whether they leave any gap.
- views: Tuple[CameraView, ...]¶
- sees_center(center_ego)[source]¶
Whether the box centre’s bearing falls in some camera’s field of view.
- Return type:
- py123d_detection.core.visibility.coverage_degrees(views)[source]¶
Total angle the cameras cover between them, counting overlap once.
- Return type:
- py123d_detection.core.visibility.rig_visibility(scene, cameras, margin_deg=0.0, iteration=0)[source]¶
Read a rig’s geometry from one frame.
Extrinsics and intrinsics are rig-static in 123D, so a single frame describes the whole log.
- Parameters:
margin_deg (
float) – Widen each camera’s field of view by this much, so a box just past the edge is not dropped over a fraction of a degree.- Return type: