feat: add overexposed_frame_pct to frame stats - #41
Conversation
kstonekuan
left a comment
There was a problem hiding this comment.
Thanks @Sagar-024! Validated locally: quality gate and full suite pass (298 tests). This matches #33 exactly, and the test work is excellent: the pure-text aggregation case, the white-tail fixture with the freezedetect guard (nice catch that 2s of identical white frames would otherwise register as a freeze), and the limited-range-white threshold note all show real understanding of the instrument. Merging.
One gentle ask for next time: you are well past needing the training wheels, so we would love to keep the good first issue pool for brand-new contributors when possible. A more valuable direction for someone at your level: run HFlow against a real corpus like Egocentric-10K (or the 100K variant) and tell us what breaks, what is slow, or what is awkward. Real-data findings like your #24 measurement are the highest-leverage contributions this project can get right now.
Summary
Adds
overexposed_frame_pcttoFrameStatsand records it per camera topic incamera_frame_stats. Closes #33.Blackout already has
black_frame_pct, but the symmetric failure (blown highlights from bad exposure, IR flood, or sun in frame) had no counterpart, andluma_avg_maxalone cannot distinguish one bright frame from a thousand. The new measurement is the percentage of frames whose average luma is at or abovebright_luma_threshold(default 235.0; thresholds stay user-owned), computed from the existingluma_avg_valueslist with the same frame-count denominator asblack_frame_pct. No new ffmpeg filter, no second decode pass.Changes
src/hflow/ffmpeg/_instrument.py:FrameStatsgainsoverexposed_frame_countandoverexposed_frame_pct;frame_stats()and_stats_from_instrument_output()gainbright_luma_threshold.src/hflow/checks.py:camera_frame_statsthreads the threshold and records{topic}/overexposed_frame_pctnext toblack_frame_pct.tests/test_ffmpeg.py: synthetic instrument-output test with exact math at the default threshold, plus a white-tail real-video test exercising the threshold parameter.tests/test_checks.py: asserts the measurement is surfaced as 0.0 on a non-bright camera fixture.Validation
Checklist