How sagarrajak245/real-time-webrtc-vlm-multi-object-detection works
This is a live mobile-to-browser WebRTC object-detection application with client-side WASM and server-side inference modes. The main workflow is phone video streaming, browser-side or queued server inference, and detection display, with WebRTC and benchmark metrics as supporting capabilities. The excerpts show key inference, queue, and API behavior; some signaling and phone-page internals are not sampled, so those links rely on README workflow statements or are left unconnected.
Main entry points: app.js Detection UI · index.js HTTP and socket server · Frameprocessor.js Frame queue · wasm-inference.js WASM inference
Components 17
Video client
- Phone capture
webrtc-detection/client/phone.html - Detection UI
webrtc-detection/client/app.js - WebRTC session
webrtc-detection/client/app.js - HTTP and socket server
webrtc-detection/server/index.js
Detection processing
- WASM inference
webrtc-detection/client/wasm-inference.js - Frame queue
webrtc-detection/server/Frameprocessor.js - YOLOv8 inference
webrtc-detection/server/inference.js - Browser model files
webrtc-detection/public/models - Server model files
webrtc-detection/server/models
Metrics and access
- WebRTC stats
webrtc-detection/client/WebRTCStatsMonitor.js - Benchmark endpoints
webrtc-detection/server/index.js - Benchmark metrics
webrtc-detection/server/index.js - Health and config
webrtc-detection/server/index.js - Ngrok and QR
webrtc-detection/server/index.js
Other components
- Phone user
- Browser user
- Ngrok service
Connections 20
- Phone user → Phone capture: captures video
README.md - Phone capture → WebRTC session: streams video
- Browser user → Detection UI: opens interface
README.md - Detection UI → HTTP and socket server: fetches config
webrtc-detection/client/app.js - Detection UI → WASM inference: runs inference
webrtc-detection/client/app.js - WASM inference → Browser model files: loads model
webrtc-detection/client/wasm-inference.js - Detection UI → WebRTC session: establishes session
webrtc-detection/client/app.js - WebRTC session → HTTP and socket server: signals session
- HTTP and socket server → Frame queue: enqueues frames
webrtc-detection/server/index.js - Frame queue → YOLOv8 inference: invokes inference
- YOLOv8 inference → Server model files: loads model
webrtc-detection/server/inference.js - Frame queue → WebRTC session: emits detections
webrtc-detection/server/Frameprocessor.js - WASM inference → Detection UI: returns detections
webrtc-detection/client/app.js - Detection UI → WebRTC stats: starts monitoring
webrtc-detection/client/app.js - Detection UI → Benchmark endpoints: posts benchmark data
webrtc-detection/client/app.js - Benchmark endpoints → Benchmark metrics: records frame metrics
webrtc-detection/server/index.js - Detection UI → Health and config: requests mode
webrtc-detection/client/app.js - HTTP and socket server → Frame queue: reads queue metrics
webrtc-detection/server/index.js - HTTP and socket server → Ngrok and QR: starts tunnel
README.md - Ngrok and QR → Ngrok service: connects optionally
README.md