All projects

ConteoBK

Occupancy control with computer vision and real-time video.

Spotlight project · AI & DataDeployed system

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.

Connected camerasMilestone · RTSPDetection & trackingDeepStream · Savant · GPU
Select a component to learn its role on the map.
  1. 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.

  2. Distribute processing

    ZeroMQ · Kubernetes · GPU

    A router balances video streams across GPU-accelerated Savant pipelines. Each pipeline container processes its assigned camera streams.

  3. 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.

  4. 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.

How it works

Camera video is converted into real-time entry/exit events and visible occupancy per facility zone.

Select a part of the architecture map to learn about its role.

Connected Cameras

The Milestone XProtect ONVIF Bridge feeds RTSP streams into the cluster. The platform manages dozens of cameras linked to specific facilities and zones.

GPU Detection Cluster

The pipeline detects and tracks individuals, registering line crossings for entries and exits. Kubernetes balances pipelines across GPUs; dashboard manages ONNX models.

Events & Occupancy

Crossings dispatch HMAC-signed event payloads to Laravel. The backend tracks zone tallies, utilizing Redis and Reverb WebSockets for live push updates.

Dashboard & Live Video

The dashboard displays live occupancy counts and capacity alerts. WebRTC delivers low-latency live video, activating GPU encoding on demand when inspected.

Looking for someone like this?

Let's talk about your engineering team and the software you need to build.

Email me