People counting system for Bilbao Kirolak (Bilbao City Council). Processes live video from multiple cameras and displays occupancy per sports center and zone on a web dashboard.
My contribution
Video pipeline, backend, and GPU infrastructure
Participated in the core system development, focusing on the video pipeline, backend services, and GPU infrastructure on Kubernetes. Connected person detection and counting with occupancy events and real-time WebRTC streaming.
The problem
Monitoring occupancy across multiple sports centers requires turning camera feeds into live, synchronized zone counts across multiple entrances and exits.
The solution
Detection and tracking pipeline using NVIDIA DeepStream and Savant that tracks tripwire line-crossings and dispatches signed events to a Laravel backend. Kubernetes distributes processing across GPUs; Milestone XProtect integration provides video streams, and React delivers live occupancy and WebRTC video.
From camera feed to zone occupancy
Counting starts at an optical sensor and ends at live zone occupancy. In between are two distinct pathways: capacity events and user-facing video streaming.
Acquire video stream
Milestone · ONVIF · RTSP
Integration with Milestone XProtect captures RTSP camera feeds. A dedicated camera adapter delivers video frames to the analysis cluster.
Distribute processing
ZeroMQ · Kubernetes · GPU
A router balances video streams across GPU-accelerated Savant pipelines. Each pipeline container processes its assigned camera streams.
Detect, track, and count
DeepStream · Savant · Python
The detector locates people and the tracker monitors trajectories. Crossing a calibrated line triggers an entry or exit event.
Update occupancy
Laravel · MySQL · Reverb
The backend receives HMAC-signed event payloads, updates occupancy counts, and pushes changes to the React dashboard via WebSockets.
Occupancy telemetry
Events update facility and zone occupancy instantly. The dashboard reflects capacity shifts without requiring anyone to open the video feed.
Live video streaming
An independent pipeline collects GPU frame buffers and delivers low-latency WebRTC streams. Transcoding runs on demand only when a user opens a camera.
Key technical challenges
A running process may have stopped counting
Health monitoring inspects actual frame throughput and processing progress beyond container health checks. Degradation detection and bounded recovery prevent pipelines from appearing green while failing to produce data.
Counting and video streaming share GPU resources
Video processing is balanced across GPUs while live video egress multiplexes the output. On-demand encoding avoids running NVENC sessions for cameras that no user is currently viewing.
Local and production environments behave differently
Documentation accounts for video pipeline limitations on consumer GPUs and establishes an MJPEG fallback for local development. Decoupling local configs from Tesla T4 production manifests ensures seamless testing under hardware constraints.
Core capabilities
- Multi-camera entry and exit line-crossing counting.
- Real-time occupancy dashboard by facility and zone with capacity alerts.
- On-demand WebRTC live video streaming and encoding.
- ONNX model management, activation, and rollback directly from the dashboard.
- Multi-GPU distributed processing and Milestone XProtect integration.

