← all repositories
duy-phamduc68/TrafficLab-3D

A digital twin from one CCTV clip and a map screenshot

TrafficLab 3D turns ordinary traffic-camera footage into a synchronized satellite-view visualization — no calibrated cameras or fancy sensors required.

★500 stars Python Computer VisionDomain Apps
Collecting fresh signals — velocity needs a few days of history.
collecting data…
star history

What it does

TrafficLab 3D is an end-to-end traffic analysis suite built around a deliberately minimal input: an mp4 from a public CCTV camera plus its location on Google Maps. It walks you through a staged calibration process (lens undistortion, homography, parallax-based camera positioning), runs YOLO detection and tracking over the footage, and renders a side-by-side “digital twin” — the CCTV view with 3D bounding boxes next to the satellite view with floor boxes, speed, and orientation.

The interesting bit

The whole point is accessibility: real traffic research usually demands calibrated cameras and synchronized high-quality aerial imagery, which students and hobbyists don’t have. TrafficLab reconstructs the camera-to-satellite projection manually — paired anchor points, subject heights, a distance measured off Google Earth — and bakes the results into a reusable G_projection JSON. Inference output is saved as compressed .json.gz so the heavy rendering never has to share a process with the detection work.

Key highlights

  • Stage-based, backwards-compatible calibration pipeline with validation steps at each phase
  • Swappable object detection models and trackers, with speed/orientation smoothing controls
  • Optional custom SVG layouts and ROI discard strategies (Adobe Illustrator assets)
  • PyQt5 GUI with three tabs — Calibration, Inference, Visualization — that keep state as you switch
  • Pre-built location projections and finetuned YOLOv8/YOLOv11 checkpoints shared via Google Drive

Caveats

  • The author is upfront that this is a monolithic proof-of-concept; a modular rewrite is the stated next step
  • Only works on a single flat planar environment — hills and overpasses need not apply
  • Tracking is taken as-is from detector/tracker output, so occlusion causes objects to vanish and vehicle boxes can rotate or teleport; no kinematic vehicle model constrains them
  • Initial calibration and SVG crafting is described as “very tedious”

Verdict

Great for students, researchers, and smart-city demo builders who want impressive traffic visualizations from public footage. Production traffic engineers should wait for the promised refactor — the physics-ignoring tracking and single-plane limitation are real constraints.

Frequently asked

What is duy-phamduc68/TrafficLab-3D?
TrafficLab 3D turns ordinary traffic-camera footage into a synchronized satellite-view visualization — no calibrated cameras or fancy sensors required.
Is TrafficLab-3D open source?
Yes — duy-phamduc68/TrafficLab-3D is open source, released under the MIT license.
What language is TrafficLab-3D written in?
duy-phamduc68/TrafficLab-3D is primarily written in Python.
How popular is TrafficLab-3D?
duy-phamduc68/TrafficLab-3D has 500 stars on GitHub.
Where can I find TrafficLab-3D?
duy-phamduc68/TrafficLab-3D is on GitHub at https://github.com/duy-phamduc68/TrafficLab-3D.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.