Naveed Ali
‹ All work

Vision · analytics

People analytics: footfall, dwell and queues

Retail and metropolitan sites wanted to know how people move through a space: where they go, how long they stay, where queues form. I built the vision pipeline that answers that from existing CCTV. The pipeline detects and tracks people across many camera feeds in real time, on edge hardware on site.

Role
Machine Learning Engineer
Period
2024 to 2025
Team
Small team
Real-timedetection and tracking on edge devices
Heatmapsfor layout and staffing decisions

This work was done for a client under confidentiality. Client names and internal tooling are not shown.

The problem

Layout, staffing and footfall decisions were being made without data. The cameras were already there; what was missing was a system that could turn their streams into counts, paths and dwell times, running continuously on site.

Decisions come from where people walk.

Constraints

Many streams, small hardwareMany feeds on edge devices with low-cost camera units.
The same person on different camerasMovement between zones only means something if one person is recognised as one person.
Crowds and occlusionPeople overlap, turn away and leave frame.
Real timeQueue density is only useful while the queue still exists.

Architecture

Camera feeds
Compressed detector
Track and re-identifywithin and across cameras
Footfall, dwell, queues, heatmaps
Compute is the ceiling, so the detector is compressed and the rest is aggregation. Hover a stage to trace it.

A smaller detector for fixed hardware

Context
Edge devices set a hard ceiling on compute; adding hardware per site wasn't an option.
Decision
A YOLO person detector compressed with knowledge distillation and pruning, then converted to ONNX for the edge runtime.
Trade-off
Some headroom in raw accuracy, traded for a model that runs on every stream at once.
  1. Detect. The distilled, pruned detector finds every person in each frame.
  2. Track and re-identify. A multi-object tracker follows each person within a feed and links them across cameras.
  3. Aggregate. Tracks become footfall by zone, dwell time, queue density and live crowd heatmaps.

What broke

Two problems took most of the effort.

  • Keeping one person as one person. Following someone across different cameras, and through the moments when other people blocked them, was the hardest part. I tried several re-identification approaches to link them.
  • Speed. The first versions were too slow for live use. The detector needed a lot of optimisation before it ran near real time on the edge hardware.

Where it landed

Many feeds processed concurrently in real time on edge hardware, producing the footfall, dwell, queue and heatmap data the sites used for layout and staffing decisions.

What I'd do differently

I would follow what is now standard practice for multi-camera tracking and re-identification. The tools have moved on since this was built, and I would start from the current approach.

References

Have a project in mind? Let’s talk.

Open to contract and full-time work. Based in Lahore, working with teams in the UK, EU and US.