frigate/frigate/test
Daniel-dev22 ae2a9c5be4 perf(util): cut redundant work in per-frame detection consolidation
video/detect.py runs these for every frame:

- get_cluster_candidates: used_boxes was a list with `in` membership tests
  inside the nested loop (O(n) per check). It is only ever membership-tested,
  so switching it to a set (O(1)) leaves output unchanged.
- get_consolidated_object_detections: area(current_box) was recomputed on
  every inner-loop iteration though it is loop-invariant; hoist it to one
  call per outer detection.

Both are bit-identical (verified against the previous implementations over
randomized inputs). Measured in the release image, get_cluster_candidates on
a frame of 30 detection boxes: 59.2 us -> 42.1 us (1.4x); the gain scales
with the number of boxes per frame.

Adds a partition-invariant test (every box index lands in exactly one
cluster).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 09:36:24 -04:00
..
http_api Add recording keyframe analysis to camera probe dialog (#23453) 2026-06-11 14:16:41 -06:00
__init__.py app container and config schema 2021-01-26 21:40:33 -06:00
const.py Work through most of the cspell warnings in python (#13794) 2024-09-17 10:41:46 -05:00
test_birdseye.py Write a low resolution low fps stream from decoded frames (#8673) 2024-01-31 12:56:11 +00:00
test_camera_maintainer.py Debug replay resolution (#23287) 2026-05-22 08:39:52 -06:00
test_camera_pw.py fix typos (#9895) 2024-02-17 16:01:50 -06:00
test_chat_find_similar_objects.py Camera access fixes (#22987) 2026-04-23 12:27:49 -06:00
test_config.py Add attributes to UI filters list (#23250) 2026-05-19 08:31:50 -06:00
test_copy_yuv_to_position.py Cleanup and organize utils (#7033) 2023-07-06 09:28:50 -05:00
test_debug_replay_job.py Debug replay fixes (#23270) 2026-05-20 16:37:02 -05:00
test_debug_replay.py Miscellaneous fixes (#23238) 2026-05-18 22:52:40 -05:00
test_deferred_processor.py Add deferred real-time processor for enrichments (#22880) 2026-04-14 21:39:44 -06:00
test_dispatcher_runtime_state.py Restore runtime state on startup (#23326) 2026-05-27 12:03:09 -06:00
test_env.py Improve environment var handling (#22796) 2026-04-07 07:16:02 -06:00
test_export_progress.py Use Job infrastructure for Debug Replay (#23099) 2026-05-03 14:54:20 -06:00
test_export.py Replace export ffmpeg argument blocklist with a structural allowlist (#23478) 2026-06-13 16:43:22 -06:00
test_ffmpeg_presets.py Update ffmpeg (#22548) 2026-03-20 08:50:58 -05:00
test_ffmpeg_progress.py Use Job infrastructure for Debug Replay (#23099) 2026-05-03 14:54:20 -06:00
test_file.py Enable event snapshot API to honour query params after event ends (#22375) 2026-03-22 13:33:04 -06:00
test_go2rtc_stream_auth.py Miscellaneous fixes (#23513) 2026-06-19 10:10:22 -06:00
test_gpu_stats.py Improve Intel Stats (#23190) 2026-05-13 15:12:48 -06:00
test_keyframe_analysis.py Add recording keyframe analysis to camera probe dialog (#23453) 2026-06-11 14:16:41 -06:00
test_maintainer.py Miscellaneous fixes (#22913) 2026-04-18 07:10:50 -06:00
test_media_auth.py Miscellaneous fixes (#23238) 2026-05-18 22:52:40 -05:00
test_motion_detector.py Skip motion threshold configuration (#22255) 2026-03-05 18:20:03 -06:00
test_motion_search_batch.py Refactor motion search (#23378) 2026-06-01 12:08:46 -05:00
test_motion_search_decode.py Refactor motion search (#23378) 2026-06-01 12:08:46 -05:00
test_motion_search_spatial.py Refactor motion search (#23378) 2026-06-01 12:08:46 -05:00
test_norfair_distance.py guard norfair distance against non-finite and zero-area boxes that could crash autotracking cameras (#23475) 2026-06-13 16:23:30 -05:00
test_obects.py Various fixes (#14410) 2024-10-17 11:02:27 -05:00
test_object_detector.py Improve async object detector support (#17712) 2025-04-15 08:55:38 -05:00
test_onvif_probe.py Support onvif PasswordText cameras in the add camera wizard (#23365) 2026-05-31 08:20:09 -06:00
test_output_ws_auth.py Camera access fixes (#22987) 2026-04-23 12:27:49 -06:00
test_preview_loader.py Offline preview image (#21752) 2026-02-26 21:27:56 -07:00
test_profiles.py Miscellaneous fixes (#23373) 2026-06-01 13:55:52 -06:00
test_proxy_auth.py Various Tweaks (#22609) 2026-03-24 13:53:39 -06:00
test_record_retention.py Improve recording retention logic (#20506) 2025-10-15 11:09:28 -06:00
test_reduce_boxes.py Smarter Regions (#8194) 2023-10-18 18:21:52 -05:00
test_runtime_state.py Restore runtime state on startup (#23326) 2026-05-27 12:03:09 -06:00
test_shared_memory_frame_manager.py Debug replay resolution (#23287) 2026-05-22 08:39:52 -06:00
test_storage.py Pull count of detection events by label into prometheus metrics (#20119) 2025-09-19 06:27:20 -06:00
test_video.py perf(util): cut redundant work in per-frame detection consolidation 2026-06-20 09:36:24 -04:00
test_webpush_camera_monitoring.py Camera access fixes (#22987) 2026-04-23 12:27:49 -06:00
test_ws_auth.py limit access to admin-only websocket topics for viewer users (#22710) 2026-03-31 08:51:55 -05:00
test_ws_outbound_filter.py Filter outbound websocket broadcasts by per-recipient camera access (#23256) 2026-05-19 14:51:16 -05:00
test_yuv_region_2_rgb.py Cleanup and organize utils (#7033) 2023-07-06 09:28:50 -05:00