decision_testbench¶
decision_testbench
¶
Decision Testbench -- Python implementation with fisheye BBox error model and parameter optimizer.
Reimplements the index.html decision simulator in Python, adds rigorous 3D bounding box projection error analysis under fisheye distortion, and optimizes decision parameters against scripted scenarios using differential evolution.
Usage
python decision_testbench.py # run all analyses python decision_testbench.py --optimize # optimize decision parameters python decision_testbench.py --error-map # generate BBox error heatmap
FisheyeCamera
dataclass
¶
FisheyeCamera(height: float = 3.6576, fov_deg: float = 197.9, radius_px: int = 1750, frame_width: int = 3500, frame_height: int = 3500, kappa: float = 1.0, cam_x: float = 5.0, cam_y: float = -13.0, pad_size: int = 3840, yolo_imgsz: int = 1280, sensor_width: int = 3840, sensor_height: int = 2160, pitch_deg: Optional[float] = 0.0, heading_deg: Optional[float] = None, cx_override: Optional[float] = None, cy_override: Optional[float] = None, k1: float = 0.0, k2: float = 0.0)
Equidistant fisheye camera model with forward and inverse projection.
Camera position matches the pole preset from index.html: (x=5, y=-13, h=5.5), looking across the crosswalk.
Intrinsics (fov_deg, cx, cy) default to values from camera_calibration.json if present, otherwise fall back to manual estimates.
downward tilt in degrees (negative = looking down).
If None, auto-computed from geometry to aim at ground at distance |cam_y| from the camera.
heading_deg: horizontal direction (degrees). If None, auto-computed from cam_y: 90 deg if cam_y < 0, 270 deg if cam_y > 0.
pixel_on_sensor
¶
Check whether a pixel in the 3500x3500 crop is within the physical sensor region.
dist_to
¶
3D distance from camera to an object at ground position (gx, gy, 0).
world_to_pixel
¶
Project 3D world points to pixel coordinates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
points
|
ndarray
|
(..., 3) world coordinates [x, y, z]. |
required |
Returns: pixels: (..., 2) pixel coordinates [u, v]. valid: (...) boolean.
Source code in decision_testbench.py
projected_bbox_area
¶
Compute the bounding box pixel area by projecting 8 3D corners.
Replicates the physical model: the fisheye lens projects onto the 3500x3500 crop, but the sensor only captures 3840x2160, clipping the top and bottom of the circle. A corner is visible only if it is within the fisheye FOV AND within the sensor band.
Returns 0.0 if no corner is visible on the sensor.
Source code in decision_testbench.py
pixel_to_ground
¶
Inverse-project pixel coordinates to the ground plane z = 0.
Uses the full rotation matrix (heading + pitch), consistent with world_to_pixel. The camera-frame ray is computed from the equidistant model and transformed to world coordinates via R^T.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pixels
|
ndarray
|
(..., 2) pixel coordinates [u, v]. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ground |
ndarray
|
(..., 3) world coordinates [x, y, z=0]. |
valid |
ndarray
|
(...) boolean mask. |
Source code in decision_testbench.py
ObjectType
dataclass
¶
ObjectType(name: str, length: float, width: float, height: float, class_id: int, ap: float = 0.5, ar: float = 0.7)
Physical dimensions and detection characteristics of an object class.
DetectionParams
dataclass
¶
Per-class detection performance parameters.
SizedDetectionParams
¶
SizedDetectionParams(overall: DetectionParams, small: Optional[DetectionParams] = None, medium: Optional[DetectionParams] = None, large: Optional[DetectionParams] = None, ar_curve: Optional[Dict] = None)
Detection params with continuous AR interpolation over bbox area.
When an ar_curve is provided (from eval_cache.json), AR is linearly interpolated over log-spaced area bins. Otherwise falls back to the 3 coarse COCO bins.
Source code in decision_testbench.py
for_area
¶
Return AP/AR for a given bbox pixel area, using interpolation.
Source code in decision_testbench.py
UncertaintyParams
dataclass
¶
UncertaintyParams(pedestrian: SizedDetectionParams = (lambda: _make_sized(0.678, 0.755))(), cyclist: SizedDetectionParams = (lambda: _make_sized(0.657, 0.747))(), vehicle: SizedDetectionParams = (lambda: _make_sized(0.706, 0.765))(), bev_angular_error_deg: float = 5.0, kf_std_weight_pos: float = 0.05, kf_std_weight_vel: float = 0.00625, kf_max_lost: int = 30, kf_iou_threshold: float = 0.2, fps: int = 30, latency_ms: float = 19.0)
Full uncertainty model parameters.
DetectionFailureModel
¶
Base class for detection failure models.
should_drop
¶
Return True if this agent should be dropped (missed) this frame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
agent_id
|
int
|
unique identifier for the tracked object. |
required |
ar
|
float
|
the per-frame average recall (detection probability) for this object at its current size/distance. |
required |
rng
|
numpy random generator. |
required |
Source code in decision_testbench.py
IIDFailureModel
¶
Bases: DetectionFailureModel
Independent identically distributed detection failures.
Each frame, each agent is dropped with probability 1 - AR, independently of all other frames. This is the simplest model and the default.
GilbertFailureModel
¶
Bases: DetectionFailureModel
Gilbert (two-state Markov) model for correlated detection failures.
States: Detected (D) and Missed (M). Transitions: P(M at t+1 | D at t) = p (miss onset) P(D at t+1 | M at t) = r (recovery)
The stationary miss rate is p / (p + r). The mean burst length (consecutive misses) is 1 / r.
The AR from the size-aware model is used to set the stationary miss rate: p / (p + r) = 1 - AR. Given a user-specified mean burst length B = 1/r, the parameters are:
r = 1 / B
p = (1 - AR) * r / AR
Reference: Gilbert, E.N. (1960). "Capacity of a burst-noise channel." Bell System Technical Journal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mean_burst_length
|
float
|
expected number of consecutive missed frames once a miss begins. Typical values: 2-5 for a decent detector. Setting to 1.0 recovers approximately i.i.d. behavior. |
3.0
|
Source code in decision_testbench.py
DecisionParams
dataclass
¶
DecisionParams(bike_memory_frames: int = 58, prox_min: float = 1.9, prox_max: float = 24.8, prox_speed_min: float = 0.147, lookback_frames: int = 2, max_range: float = 25.0, max_object_age: int = 10, speed_adaptive: bool = True, decision_rule: str = 'pairwise', ttc_threshold_s: float = 3.0)
Parameters for constructing a DecisionPipeline instance.
CyclistBrakingProfile
dataclass
¶
Cyclist perception-reaction time and braking deceleration.
DangerAssessment
dataclass
¶
DangerAssessment(is_danger: bool, actionable: bool, severity: float, ttc: float, d_min_future: float, closing_speed: float, bike_speed: float, stopping_dist: float, warning_budget: float, distance: float)
Per-frame danger assessment for a bike-pedestrian pair.
Two-tier danger labeling
is_danger: True if the situation is physically threatening (collision trajectory + insufficient stopping distance or low TTC). actionable: True if is_danger AND the system's warning can still change the outcome (TTC > pedestrian PRT). Frames with is_danger but not actionable are "imminent" — the alert is correct but the pedestrian cannot react in time.
Sensitivity is computed over actionable frames only. Specificity treats all danger frames (actionable + imminent) as expected-alert, so alerting during imminent danger is not penalized.
TrackedObject
¶
Single tracked object with Kalman-style position prediction.
Maintains EMA-smoothed velocity and acceleration estimates for both first-order (constant velocity) and second-order (constant acceleration) prediction.
Source code in decision_testbench.py
update
¶
Update with a new detection (matched).
Source code in decision_testbench.py
predict
¶
GroundPlaneTracker
¶
Ground-plane nearest-neighbor tracker with constant-velocity prediction.
Matches detections to existing tracks by metric distance in the BEV ground plane, consistent with the deployed GroundPlaneTracker in mqtt_bridge.py. Key behaviours: - Tracks persist across missed detections for up to track_buffer frames using constant-velocity prediction. - Detections are matched to existing tracks by greedy nearest-neighbour within match_radius (meters). - Unmatched detections create new tracks. - Tracks exceeding track_buffer lost frames are removed.
Source code in decision_testbench.py
update
¶
Process one frame of detections, return active tracked agents.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
detections
|
List[Dict]
|
list of {'id': int, 'type': str, 'x': float, 'y': float, 'heading': float} for agents detected in this frame. |
required |
Returns:
| Type | Description |
|---|---|
List[Dict]
|
list of dicts in the same format, including tracks that were not |
List[Dict]
|
detected but are still within the track_buffer timeout (predicted). |
Source code in decision_testbench.py
1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 | |
forecast
¶
Predict agent positions n_frames into the future.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
agents
|
List[Dict]
|
tracked agent dicts with vx, vy, ax, ay. |
required |
n_frames
|
int
|
number of frames to predict forward. |
required |
order
|
int
|
1 = constant velocity, 2 = constant acceleration. |
1
|
Both orders run in O(N) time for N tracks. The second-order forecast adds one multiply-accumulate per track per axis — negligible on the Orin.
Source code in decision_testbench.py
load_camera_calibration
¶
Load calibrated intrinsics from JSON produced by calibrate_fisheye.py.
object_3d_corners
¶
Compute the 8 corners of a 3D bounding box on the ground plane.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gx, gy
|
ground-plane position (object center). |
required | |
obj
|
ObjectType
|
object type with dimensions. |
required |
heading_rad
|
float
|
yaw angle (radians, 0 = facing +x). |
0.0
|
Returns:
| Name | Type | Description |
|---|---|---|
corners |
ndarray
|
(8, 3) array of 3D world coordinates. |
Source code in decision_testbench.py
compute_bbox_error
¶
compute_bbox_error(cam: FisheyeCamera, gx: float, gy: float, obj: ObjectType, heading_rad: float = 0.0) -> Dict
Compute the localization error from using the bottom-center of the tightest 2D bounding box around a fisheye-projected 3D object.
The detector is assumed to find the tightest axis-aligned rectangle enclosing all visible projected corners of the 3D bounding box.
The error is the metric displacement between the true ground position and the position obtained by inverse-projecting the bbox bottom-center pixel.
Returns a dict with error metrics, or None if the object is not visible.
Source code in decision_testbench.py
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 | |
compute_error_grid
¶
compute_error_grid(cam: FisheyeCamera, obj: ObjectType, max_range: float = 25.0, grid_step: float = 0.5, heading_rad: float = 0.0) -> Dict
Compute BBox localization error over a grid of positions within max_range.
The grid is in camera-relative coordinates (forward / lateral). World positions are computed from the camera's position and heading.
Returns arrays for plotting: X, Y grids and error magnitudes.
Source code in decision_testbench.py
print_error_summary
¶
Print a table of BBox errors at selected distances and angles for each object type.
Distances and angles are measured from the camera position along the camera's forward (heading) direction, matching how mqtt_bridge produces camera-relative BEV coordinates.
Source code in decision_testbench.py
load_uncertainty_from_cache
¶
Load AP/AR values from eval_cache.json into UncertaintyParams.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cache_path
|
str
|
path to eval_cache.json produced by eval_models.py. |
required |
model_name
|
str
|
which model entry to use. If None, uses the first one. |
None
|
Returns:
| Type | Description |
|---|---|
Optional[UncertaintyParams]
|
UncertaintyParams with real AP/AR values, or None if cache not found. |
Source code in decision_testbench.py
compute_position_uncertainty
¶
compute_position_uncertainty(cam: FisheyeCamera, gx: float, gy: float, obj: ObjectType, unc: UncertaintyParams) -> Dict
Compute position uncertainty for an object at a given location.
Source code in decision_testbench.py
make_pipeline
¶
make_pipeline(params: DecisionParams, fps: int = 30, profile: Optional[CyclistBrakingProfile] = None) -> DecisionPipeline
Create a DecisionPipeline from DecisionParams.
Source code in decision_testbench.py
run_pipeline_on_agents
¶
run_pipeline_on_agents(pipeline: DecisionPipeline, agents: List[Dict], sim_time: float, cam_x: float = 0.0, cam_y: float = 0.0) -> str
Adapter: split agents by type, feed the shared pipeline, return state.
Coordinates are transformed to camera-relative before entering the pipeline, matching the mqtt_bridge deployment where the fisheye inverse-projection produces camera-centred BEV coordinates.
Source code in decision_testbench.py
interpolate_agent
¶
Interpolate agent position and heading at time t from waypoint path.
Heading is computed from the velocity vector of the current path segment, in radians (0 = facing +x direction).
Source code in decision_testbench.py
estimate_closing_speed
¶
Estimate closing speed between bike and pedestrian (m/s).
Positive value means distance is decreasing.
Source code in decision_testbench.py
estimate_agent_speed
¶
Estimate agent ground speed (m/s) from trajectory at time t.
Source code in decision_testbench.py
stopping_distance
¶
stopping_distance(speed_ms: float, decel: float = BIKE_DECEL_MS2, reaction_s: float = CYCLIST_REACTION_S) -> float
Compute stopping distance = reaction_distance + braking_distance.
Source code in decision_testbench.py
time_to_collision
¶
time_to_collision(bike_def: Dict, ped_def: Dict, t: float, lookahead: float = 5.0, dt: float = 0.05, conflict_radius: float = CONFLICT_ZONE_HALF_WIDTH_M) -> Tuple[float, float, float]
Estimate time to collision, minimum future distance, and closing speed.
Returns:
| Name | Type | Description |
|---|---|---|
ttc |
float
|
seconds until distance < conflict_radius (inf if no collision). |
d_min |
float
|
minimum distance within lookahead window. |
v_close |
float
|
current closing speed (m/s, positive = approaching). |
Source code in decision_testbench.py
get_braking_profile
¶
Return the braking profile for a scenario based on its vehicle tag.
compute_ground_truth_danger
¶
compute_ground_truth_danger(scenario: Dict, t: float, convergence_m: float = 5.0, stop_margin: float = 0.8, ttc_threshold_s: Optional[float] = None) -> DangerAssessment
Compute danger using a kinematic safety model.
Danger is defined by the relationship between stopping distance and current distance: if the cyclist cannot stop before reaching the pedestrian's conflict zone, the situation is dangerous.
The severity is proportional to the square of the cyclist's speed, normalized to MAX_SEVERITY_SPEED_MS, reflecting the kinetic energy of a potential impact.
Source code in decision_testbench.py
1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 | |
simulate_scenario
¶
simulate_scenario(scenario: Dict, params: DecisionParams, fps: int = 30, cam: Optional[FisheyeCamera] = None, add_bbox_noise: bool = False, detection_ar: Optional[float] = None, rng: Optional[Generator] = None, use_tracker: bool = True, camera_delay_frames: int = 0, forecast_order: int = 0, uncertainty: Optional[UncertaintyParams] = None, failure_model: Optional[DetectionFailureModel] = None) -> Dict
Run a scenario through the decision pipeline and record state history.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scenario
|
Dict
|
scenario definition with agents and paths. |
required |
params
|
DecisionParams
|
decision pipeline parameters. |
required |
fps
|
int
|
simulation frame rate. |
30
|
cam
|
Optional[FisheyeCamera]
|
fisheye camera for BBox noise injection. |
None
|
add_bbox_noise
|
bool
|
whether to perturb positions by fisheye BBox error. |
False
|
detection_ar
|
Optional[float]
|
if set, stochastically drop detections with P(miss) = 1 - ar. |
None
|
rng
|
Optional[Generator]
|
random generator for stochastic detection. |
None
|
use_tracker
|
bool
|
if True, simulate ByteTrack persistence across missed detections (default True). |
True
|
camera_delay_frames
|
int
|
number of frames of camera/pipeline latency. The decision pipeline sees positions from this many frames ago, while ground truth is evaluated at the current time. At 30 fps, 1 frame = 33 ms. |
0
|
forecast_order
|
int
|
0 = no forecast, 1 = constant velocity, 2 = constant acceleration. Applied when camera_delay_frames > 0. |
0
|
Returns dict with time series of states and comprehensive safety metrics.
Source code in decision_testbench.py
1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 | |
run_all_scenarios
¶
run_all_scenarios(params: DecisionParams, fps: int = 30, cam: Optional[FisheyeCamera] = None, add_bbox_noise: bool = False, verbose: bool = True, camera_delay_frames: int = 0, forecast_order: int = 0, uncertainty: Optional[UncertaintyParams] = None) -> List[Dict]
Run all scenarios and return results.
Source code in decision_testbench.py
run_monte_carlo
¶
run_monte_carlo(params: DecisionParams, n_trials: int = 50, fps: int = 30, cam: Optional[FisheyeCamera] = None, detection_ar: float = 0.747, add_bbox_noise: bool = False, uncertainty: Optional[UncertaintyParams] = None, failure_model: Optional[DetectionFailureModel] = None) -> Dict
Run Monte Carlo simulation with stochastic detection failures.
Each trial randomly drops detections based on the average recall rate. When a camera is provided, the drop rate is size-aware: objects that are small on the sensor are dropped at the per-size AR from the eval cache, so distant objects are missed more frequently than close ones.
Source code in decision_testbench.py
2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 | |
optimization_cost
¶
optimization_cost(x: ndarray, fps: int = 30, w_fn: float = 5.0, w_fp: float = 1.0, w_lat: float = 2.0, cam: Optional[FisheyeCamera] = None, add_bbox_noise: bool = False) -> float
Cost function for decision parameter optimization.
The cost function balances five objectives
- Severity-weighted false negative rate (missed high-speed threats cost more)
- False positive rate (alert fatigue erodes trust)
- Alert latency (earlier warnings save lives)
- Reaction adequacy penalty (alerts too late for pedestrian reaction)
- Alert fatigue penalty (systems that alert too often get ignored)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
ndarray
|
parameter vector [bike_memory_frames, prox_min, prox_max, prox_speed_min, lookback]. |
required |
w_fn
|
float
|
weight for severity-weighted false negatives. |
5.0
|
w_fp
|
float
|
weight for false positives. |
1.0
|
w_lat
|
float
|
weight for alert latency. |
2.0
|
Returns:
| Type | Description |
|---|---|
float
|
Scalar cost (lower is better). |
Source code in decision_testbench.py
2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 | |
optimize_parameters
¶
optimize_parameters(fps: int = 30, cam: Optional[FisheyeCamera] = None, w_fn: float = 5.0, w_fp: float = 1.0, w_lat: float = 2.0, add_bbox_noise: bool = False) -> DecisionParams
Find optimal decision parameters using differential evolution.
Parameter bounds
bike_memory_frames: [0, 120] prox_min: [0.5, 5.0] m prox_max: [5.0, 25.0] m prox_speed_min: [0.01, 0.5] m/frame lookback_frames: [1, 10]
Source code in decision_testbench.py
2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 | |
compare_pipelines
¶
compare_pipelines(cam: Optional[FisheyeCamera] = None, add_bbox_noise: bool = False, uncertainty: Optional[UncertaintyParams] = None)
Run all scenarios under each named pipeline configuration and compare.
Source code in decision_testbench.py
run_latency_sweep
¶
run_latency_sweep(params: DecisionParams, fps: int = 30, cam: Optional[FisheyeCamera] = None, max_delay_ms: int = 500, step_ms: int = 33, save_figure: bool = True, uncertainty: Optional[UncertaintyParams] = None, add_bbox_noise: bool = True)
Sweep camera latency from 0 to max_delay_ms and plot the effect.
Each step is one frame (33 ms at 30 fps). At each latency setting, runs all scenarios deterministically and records aggregate sensitivity, specificity, and severity-weighted FN rate.
Source code in decision_testbench.py
2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 | |