From 70% to 21% CPU: making edge vision share a factory PC
Running a detector on every frame took the whole industrial PC. Four small changes fixed it without losing a single detection.

The SCADA PC also runs a vision module that checks whether operators are present in safety zones around running machines. The first version ran a person detector on every frame — and drove the PC to 100% CPU as soon as both lines' cameras were on. Data acquisition, the real job, started to suffer.
Four changes
- Decode on demand. Keep the stream current with
grab(), and decode a frame only when the analyser actually needs one. - Motion gating. Run the detector only when enough pixels have changed inside the zones — or when the last check is older than 10 seconds, so a still operator is still confirmed.
- Adaptive interval. Make the analysis interval at least twice the measured processing time, so vision never takes more than about half a thread.
- Resource limits. Run vision threads at below-normal priority and draw annotated snapshots only when someone opens them in a browser.
I also moved from YOLOX-S to YOLOX-Tiny: about 0.13 s instead of 0.5 s per check on recorded footage, with the same people detected.
Result
On the bench, vision CPU dropped from about 70% to 21% of one core, about 40% of detector runs were skipped, and the detections did not change. The lesson: on an edge device, when you run the model matters as much as which model you run.