Qalab Hassnain AghaCo-Founder & CTO

Computer Vision · Retail Analytics · Proof of Concept

Counter Watch

Is Someone Serving the Customer? Staff Presence from Shop CCTV

PythonYOLOX-tiny · ONNX RuntimeByteTrack trackingZone polygons (supervision)CPU onlyStatic dashboard
Counter Watch (Is Someone Serving the Customer? Staff Presence from Shop CCTV): Salesperson walks away: waiting time starts counting screenshot
Salesperson walks away: waiting time starts counting

My roleI built the proof of concept end to end: the detection and tracking pipeline, the staff and customer logic, the evaluation against hand-labelled footage, and the demo dashboard.

A customer walks up to a fragrance counter, picks up a tester and looks around. Nobody comes. Thirty seconds later they put it down and leave. The manager never finds out, because nobody watches the CCTV.

The brief was narrow on purpose: from the camera that is already there, tell when a salesperson is attending a customer and when a customer is left alone. Not who they are. Just whether someone is serving.

  • One ordinary fixed CCTV camera, mounted high, with people facing away, overlapping and partly hidden.
  • No face recognition, no identity and no demographics. Video stays in the shop; only counts, states and times leave.
  • Cheap to run: on a CPU next to the camera, no graphics card.
  • A false "customer waiting" is the most damaging error, because it blames staff for time they were actually serving.
  1. D1Roles come from where people standEach person's box is placed in a zone drawn on the camera view: behind the counter is staff, in front of it is a customer, anywhere else is a passer-by. No appearance model, no faces. Two counts give four states: being served, waiting, salesperson free, empty.Trade-off A staff member restocking on the customer side counts as a customer. A uniform classifier could fix that later; it was not needed to prove the idea.
  2. D2A hold, not a hair triggerThe spec's rule, a state must hold for 10 continuous seconds, never confirmed anything on one clip because detections drop out whenever someone turns their back. A presence hold keeps a salesperson present for 10 seconds after the last sighting, and a customer for 3. When a hold runs out, the change is dated back to the last sighting, so waiting time is not under-counted.
  3. D3Look again before declaring the counter emptyWhen no salesperson is found, the staff area is cropped, enlarged and checked a second time. That second look is what made the jewellery counter clip, with staff mostly showing their backs, work at all.
  4. D4Count visits, not tracksTrackers lose and re-create ids. On a busy counter that turned 4 real customers into 16 "visits". Merging id changes that are close in time and space, with a 2 second minimum stay, gives the true count.

A salesperson walks away

  1. ServedOne salesperson behind the desk, one customer in front. The state is confirmed as customer being served.
  2. GoneThe salesperson walks out of the staff zone. The hold keeps them present for 10 seconds in case they only turned away.
  3. WaitingThe hold runs out. The state changes to customer waiting, dated back to the moment they were last seen.
  4. RecordThe timeline splits into time served and time the customer stood alone, which is the number the manager wants. On this clip it matched the hand labels on all 18 checks.
  • Camera placement beats any model. On the one clip that failed, the receptionist was behind a desk and visible in only 27% of frames. No rule can tell "left" from "hidden".
  • Check the boxes, not only the score. A visual review found doubled boxes and zone gaps that a 100% status score had hidden.
  • Public clips prove the logic. Only the client's own camera proves the business numbers.
What problem did Counter Watch solve?

A fragrance counter has one fixed CCTV camera and a simple question from management: when a customer walks up, is anyone there to serve them, and how long do customers wait when nobody is? Watching hours of footage by hand does not scale, and recognising faces was never wanted.

Who built Counter Watch, and how does it work?

I did (Qalab Hassnain Agha). I built the proof of concept end to end: the detection and tracking pipeline, the staff and customer logic, the evaluation against hand-labelled footage, and the demo dashboard. How it works: A pipeline that finds people in each frame with a small detector, follows them with a tracker, and decides who is staff and who is a customer by which zone they stand in: behind the counter or in front of it. From those two counts it keeps four states, customer being served, customer waiting, salesperson free and counter empty, and only confirms a state once it has held. A presence hold keeps a salesperson who turns their back from flickering out, and a zoomed second look checks the staff area before declaring it empty. A visit layer merges broken tracks so one customer counts as one visit, and a demo dashboard plays each clip with its status and timers. Stack: Python, YOLOX-tiny · ONNX Runtime, ByteTrack tracking, Zone polygons (supervision), CPU only, Static dashboard.

What results did Counter Watch achieve?

Matched hand-labelled states on 5 of 6 real shop CCTV clips: 100, 97, 100, 95 and 100%. Customer visit count on a busy counter corrected from 16 raw tracks to 4 real visits. Found the one failure that matters: staff hidden behind a desk becomes false waiting time, fixed by camera placement. Runs on CPU only, about 4 times faster than real time on recorded clips.

Can I hire Qalab to build something similar to Counter Watch?

Yes. Contracts from $25 an hour, full-time remote from $3,000 a month, fixed-price prototypes from $600 and builds from $2,000, and fractional CTO retainers from $800 a month. Book a free 30-minute call and I will tell you honestly whether and how I would build it.

Counter Watch: Customer being served, desktop screenshot
Customer being served
Counter Watch: Customer left waiting at the counter, desktop screenshot
Customer left waiting at the counter
Counter Watch: Crowded till: two staff, two customers, desktop screenshot
Crowded till: two staff, two customers