TATraffic Analyzer

Exploratory data analysis

What the four sample clips told us

4 clips, 18 min 24 s of footage in total, all from one fixed 4K camera over a signalised junction with zebra crossings and a refuge island. Everything below is computed from the clips by web/scripts/build_sample_data.py.

Video properties

Every clip is 4K H.264 at 140 Mbit/s and 29.97 fps. The task text says 25 fps, so frame timestamps must come from the file's real rate, never an assumed one. At 4K, decoding alone is the main runtime cost. Lighting is not constant: mean brightness ranges from 45 to 96 across clips, so detection thresholds need checking on the darkest clip, not only the brightest.

ClipResolutionfpsLengthFramesSizeBrightness
C38963840×216029.97340.3 s10,2005.81 GB95
C38973840×216029.97317.8 s9,5255.44 GB96
C39023840×216029.97317.8 s9,5255.44 GB66
C39053840×216029.97127.6 s3,8252.19 GB45

Traffic and pedestrians per clip

Detections per sampled frame from our fine-tuned YOLO. “Red seen” is the share of sampled seconds with at least one red signal head detected.

ClipVehicles, meanVehicles, peakPeople, meanPeople, peakRed seenMoving area
C389629.34316.23055%3.9%
C389725.03823.83453%3.9%
C390230.44727.64449%4.2%
C390532.74224.04263%2.9%

Finding: the “fixed” camera is not pixel-identical across clips

Our scene polygons (lanes, stop lines, crossings, island) were drawn on C3897. On C3902 the same features sit 38 px away at 1280×720, about 115 px in the original 4K. Unaligned crossing polygons overlap the aligned ones by only 27–47% on C3902, and in a spot check alignment changed the crossing membership of 111 of 361 person detections, so point-in-zone rules would have fired in the wrong place. We now estimate one homography per video from stationary SIFT features before any rule runs.

ClipResidual beforeResidual afterTransform used
C38960.29 px0.22 pxIdentity
C38970.21 px0.17 pxIdentity (reference clip)
C390238.35 px0.38 pxHomography
C390515.04 px0.40 pxHomography
Scene polygons on C3902 before and after alignment
C3902: scene polygons before alignment (red) and after (green).
Scene polygons on C3905 before and after alignment
C3905: scene polygons before alignment (red) and after (green).

Per-clip time series and heatmaps

Counts by class over time, signal phases, lighting, motion, lane directions and where road users actually walk and drive.

Road users over time

Detections per frame every 2 s (fixed_names.pt, 1280 px, confidence ≥ 0.25). Counts are detections, not unique objects. Click a name to hide it.

Traffic-signal phases

Seconds where the detector saw a red or green signal head. Several heads are visible at once, so both rows can be on together. This is what red_light and stop_line rules key on.

Red light seen
Green light seen

Lighting

Mean frame brightness (luma, 0–255).

Motion

Share of the image that changed between frames (frame differencing, ~10 fps).

Motion heatmap for C3896
Motion heatmap: darker blue = pixels that change more often. Lanes, crossings and turning paths stand out.
Dominant motion direction for C3896
Dominant direction of motion (optical flow) per cell. This is how lane directions for wrong_way were checked.
Detection positions for C3896
Ground contact point of every detection: blue = pedestrians and cyclists, orange = motor vehicles.