What I tried
Initially, I sent the OpenCV camera frames and inference results from Python → FastAPI → Electron using WebSockets.
Problem
The FPS dropped massively (video feed was barely moving).
The stream had noticeable lag/delay, making real-time inference unusable.
It seems WebSockets added too much overhead for continuous high-frame-rate video data.
Logs and small data still work fine through WebSockets, but video frames choke the pipeline.
Decision / Workaround
To fix this, I’m switching the real-time OpenCV inference to run directly via a child_process (Electron spawning Python).