Commit Graph
4 Commits
Author SHA1 Message Date
Daniel-dev22andClaude Opus 4.8 56f048794b perf(motion): compute contrast percentiles from a histogram, not np.percentile
ImprovedMotionDetector.detect() runs on every frame of every camera. With
improve_contrast enabled (the default), it called np.percentile twice per
frame to find the 4th/96th percentile of the resized motion frame, each call
partitioning the whole array.

Compute both percentiles from a single 256-bin uint8 histogram instead. The
result is bit-identical to int(np.percentile(...)) (the values are used as
uint8 contrast bounds); only the array is now scanned once rather than
partitioned twice.

Measured in the release image on a height-100 motion frame (the default):
np.percentile x2 ~225 us -> histogram ~11 us per frame (~20x). This runs per
frame per camera, so it scales with camera count.

Adds a test asserting the histogram percentiles equal numpy's across uniform,
low-contrast, single-color and bimodal frames.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 17:19:28 -04:00
DanielandNicolas Mowen d93d6262ce Use 127.0.0.1 for chroma (#12135) 2024-08-29 20:19:50 -06:00
DanielandGitHub 7e5eb82882 Delete download-models (#10755) 2024-03-30 13:23:32 -06:00
DanielandGitHub cc6e049966 Change multiselect camera icon (#8016)
* CenterFocusString icon

* Add CenterFocusString to multiselect

* Rename CenterFocusString.jsx

* Rename icon and make it smaller

* Rename icon

* Fix lint and use icon
for speech

* remove unused vars

* Remove unused import
2023-10-08 14:30:53 -05:00