Home / Flagship work / TMCS

Case study Arya Omnitalk · production

TMCS — turning the highway cameras already installed into automatic incident detectors.

TMCS (Traffic Monitoring Camera System) watches live PTZ camera feeds along a national highway and raises incidents on its own: a stopped or parked vehicle, a car going the wrong way, a person or an animal on the road, debris, a queue. It follows NHAI's ATMS standards (2023), which put a monitoring camera roughly every kilometre.

A control room can't hire one more operator for every new camera. TMCS does the constant watching and hands the operator a short, checked event with evidence, so people only look at what matters. It works with cameras from different vendors, day and night, without replacing anything already on the poles.

Solution overview PDF · 14 pages
Role
Core engineer: vision pipeline, tracking, rule engine, PTZ handling, evidence and access control
Domain
Highway ATMS · NHAI ATMS Standards & Specifications (2023)
Scale
26 camera streams running at once on one GPU server
Stack
FastAPI · asyncpg · PostgreSQL · YOLO + RT-DETR · ByteTrack
Status
In production · proprietary

Concurrent streams

26

on one GPU server; capacity depends on the hardware

Incident rules

7

time-based, on frame capture timestamps

Object classes

11

vehicles, people, animals, debris

Automated tests

360

unit, integration and failure cases

Camera feed → confirmed incident

Nothing becomes an alert until every stage agrees.

  1. 01Camera · ONVIFany vendor, PTZ control
  2. 02RTSP ingestauto-reconnect, newest frame only
  3. 03Preset checkzones for the current PTZ position
  4. 04DetectionYOLO vehicles + RT-DETR people, animals, debris
  5. 05TrackingByteTrack, time-aware Kalman
  6. 06Rule engine7 rules on real time, not frame counts
  7. 07Incidentone event per incident, with start and end
  8. 08Evidence & hand-offwrite-once + SHA-256 · SSE to the control room

Measured internal engineering numbers

Tracking + rules per frame (model time not included)

10 objects1.5 ms
40 objects5.3 ms
80 objects10.3 ms

Median, measured on a CPU-only dev machine. It grows roughly in a straight line with the number of objects, so the logic around the models never becomes the bottleneck.

Loading PTZ presets

2,500 → <10ms

one batched SQL upsert instead of one round trip per preset

Track memory

60s

a person or animal keeps its ID while a truck passes in front

Hard problems, and how I solved them

A

Two models, each doing its job

A custom-trained YOLO model finds vehicles, and RT-DETR finds people, animals and debris. The detector is stateless and shared by all cameras, and every event records which model versions fired it.

B

Riders aren't pedestrians

A person on a motorbike or in an auto-rickshaw is still a "person" to the model. TMCS links people to the vehicle they're sitting on by geometry, so riders don't raise pedestrian alarms but someone standing next to a vehicle still does.

C

Tracking through occlusion

Weak new tracks survive one missed frame, and people and animals keep their ID for up to 60 s. This is the tracker I later ported into VIDS when it missed a dog standing in a lane.

D

Night and glare

Headlight glare and wet-road reflections look like objects. TMCS tracks scene brightness and filters glare, and raises the bar for new tracks at night. It never assumes night from the clock, because a tunnel is dark at noon.

E

Cameras that move

When an operator moves a PTZ camera, the old zones no longer match the picture. Every move clears the tracks and pauses analytics until the view settles, then loads that preset's zones. The camera returns to its watch position on a timer.

F

Dead cameras fail fast

A camera that drops off the network used to block a worker for 10–30 s. An ONVIF supervisor with a circuit breaker now skips dead cameras right away, and shutdown is clean and predictable.

G

Evidence that can't be edited

Evidence images are written once and get a SHA-256 hash. Boxes and labels are drawn as an overlay on top, never into the original. Each event stores the model, rule and config versions that produced it.

H

Living next to the existing system

TMCS shares the company's main VMS/ATCC database through a device-scoped view instead of a database of its own. Its access control reuses the same users and roles, and a permission change applies on the very next request.

7 incident rules 11 object classes

  • Stopped vehicle
  • Wrong-way driving
  • Pedestrian on highway
  • Animal on road
  • Debris
  • Queue / congestion
  • Parked vehicle

Car · Motorcycle · Truck · Bus · Mini bus · Auto-rickshaw · Tractor · Bicycle · Pedestrian · Animal · Road debris

How changes reach a live highway

  • Tested off the road firstsimulator, recorded footage and shadow mode, so a rule can be tested without a real camera
  • Config with historyzones, rules and models go through draft, check, approve and publish, and old versions are kept
  • Honest status"command sent" is never shown as "done", and features degrade gracefully
  • Secrets out of codecamera passwords and API tokens never appear in code or logs

Layers each one owns one job

  1. DeviceONVIF discovery, credentials, PTZ control
  2. MediaRTSP ingest, decode, timestamps, reconnect, stream health
  3. ScenePTZ preset state, zones, lanes, direction
  4. AIdetection, tracking, GPU scheduling across cameras
  5. Rules & eventschecks, incident lifecycle, de-duplication, evidence
  6. IntegrationATMS hand-off, message signs, patrol dispatch

Stack

  • Python 3.11
  • FastAPI
  • asyncpg
  • PostgreSQL
  • PyTorch
  • YOLO
  • RT-DETR
  • TensorRT
  • ByteTrack
  • OpenCV
  • ONVIF
  • RTSP
  • MediaMTX
  • SSE
  • Flask
  • pytest

TMCS is a proprietary Arya Omnitalk system. The linked PDF is Arya Omnitalk's client-facing overview. Source code and client details are confidential, and the numbers above are internal engineering measurements.