occupancy_iou

Formula

occupancy_iou = occupied_intersection / occupied_union

Cells are occupied when booleans are true or numeric values are greater than 0.5.

Hand-Computable Example

Prediction grid:

1 0
1 1

Ground truth grid:

1 1
0 1

Intersection is 2, union is 4.

Expected output: 0.5.

Edge Cases

  • Missing occupancy grids return 0.0.
  • Empty union returns 1.0.
  • Shape mismatch raises an error.

Limitations

This metric assumes aligned grids. It does not handle coordinate transforms or probabilistic calibration.

Test References

  • tests/golden/test_openloop_metrics_golden.py
  • tests/test_openloop_metrics.py