← Portfolio
PS TRAFFIC INFERENCE STUDYPUNEETPAL SINGH

ENGINEERING REPORT

Optimizing
traffic inference.

One YOLO11n checkpoint. Four inference runtimes. A measured study of execution speed, detection accuracy and the video pipeline around the model.

30 seconds of recorded traffic, processed live in your browser.

Accelerator
One Tesla T4
Host
2 physical / 4 logical CPU cores
Input
320 × 320 · batch 1
Scope
One Kaggle host / session
FIG. 01GPU runtime comparisonMedian FPS

Zero-based bars; whiskers show ten-trial min–max. Reference: PyTorch FP32, 95.92 FPS. TensorRT FP32: 236.39 FPS; FP16: 258.37 FPS.

Paired-round TensorRT FP16 / PyTorch FP32: 2.694× (exploratory 95% interval 2.672–2.716×). FP16 / TensorRT FP32: 1.091×. These separate the runtime/configuration comparison from the incremental precision comparison.

Study record13 cases · 130 timing trials · 4,488 evaluation images · 512 separate calibration images · 72 serving runs

The controls explore saved measurements.

01

RUNTIME

Compare the execution paths.

The checkpoint, input size and batch stay fixed. Switch hardware to compare runtimes on that device. Select a bar for its values and explicit reference.

FIG. 02Runtime throughput

Inspect all 13 configurations
Preprocessing, inference, NMS and completed CPU result transfer; decode and tracking excluded.
ConfigurationMedian FPS [range]Median trial p95 msCOCO mAPGlobal loss / ptVehicle loss / ptArtifact / MiB

† Retained thermal diagnostic flag. Accuracy reference: PyTorch CUDA FP32, COCO mAP 0.284270 and vehicle AP 0.332202.

Real-image warm-up; ten randomized rounds; ≥20 seconds per trial. FPS whiskers are observed min–max, not confidence intervals. Latency is the median of trial p95 values; its trial range is absent from this summary. PyTorch used four CPU threads and cuDNN autotuning off; ORT four intra-op / one inter-op thread; OpenVINO four threads / one stream. A stronger tuned PyTorch baseline remains unmeasured.

02

PRECISION

Measure what quantization changes.

Speed and accuracy share no single score here. The plots show both, with fixed axes across runtime selections on each device. Tiny AP changes remain tiny on the chart.

FIG. 03AThroughputFPS
FIG. 03BAccuracy lossAP points
All COCO classesVehicles

Speed: zero-based linear axis, whiskers show trial min–max. Accuracy: fixed −0.1 to 6.0 point axis, including small negative differences. The historical 1.0-point quality target is not treated as a validated acceptance boundary. AP uncertainty is unmeasured.

4,488 COCO evaluation images, disjoint from 512 calibration images. FP16/INT8 flags allow mixed execution; OpenVINO FP16 describes weight storage. Negative measured AP loss does not establish an improvement.

03

CAMERA LOAD

Show the latency curve.
Let the application set the limit.

Where did 100 ms and 15 FPS come from?

They were chosen study targets, fixed in the notebook before these runs. They were not derived from a customer requirement, traffic standard or validated counting task. The earlier pass/fail framing overstated their meaning. Results below are measurements, without those targets being treated as production acceptance criteria.

Six serving configurations, four camera loads, three repeats each. Rendering was off. Highlight a runtime to inspect its curve and repeat spread against the other recorded configurations.

FIG. 04ASlowest-camera rateFPS
FIG. 04BWorst-camera p95 agems · log

X-axes: actual camera counts, linear scale. FPS: fixed zero-based 0–35 axis. Frame age: fixed 10–100,000 ms logarithmic axis; each major y-step is ×10. Points: medians of three repeats. Whiskers: highlighted runtime’s observed repeat min–max. No SLA line is assumed.

Compute-load replays of the original short recording, distinct from the Norway demo below. One decoder thread per camera; capacity-one queues drop the oldest decoded frame. Counting and traffic-domain accuracy are unvalidated. TensorRT FP16 was not in this serving matrix, so its camera capacity is unknown. Long sessions, independent views and network behavior remain untested.

04

PROFILING

Locate the work outside the detector.

TensorRT INT8, first recorded repeat. Stage p95 values share a fixed 0–120 ms scale. Decoder lag is a separate measure of lateness, not a stage duration.

Hollow markers: the measured one-camera reference
FIG. 05Individual stage p95ms

Bars: selected camera count. Diamonds: one-camera reference, with values stated below. Quantiles cannot be summed.

Interpretation

The measurements point to CPU work and decode pacing upstream of the detector. A bounded queue after decode does not remove lateness already accumulated before entry.

GPU decode, earlier resizing and skipping overdue source frames are proposed experiments, not completed optimizations.

All 72 recorded profiles ↓
05

METHOD & EVIDENCE

What the measurements establish.

Implemented

Detection, per-camera ByteTrack, crossing and zone telemetry, paced replay, bounded queues, profiling, isolated workers, resumable experiments and export/precision checks.

Comparison references

GPU throughput: eager PyTorch FP32, 95.92 FPS. CPU throughput: PyTorch FP32, 32.40 FPS. Accuracy: PyTorch CUDA FP32, 0.284270 COCO mAP and 0.332202 vehicle AP. Precision speed comparisons use the selected runtime’s FP32 result, stated beside the plot.

Limits

One host/session. One retained ONNX CUDA FP32 timing trial recorded a thermal flag. No AP confidence intervals or independent traffic labels. 640px and tuning were not completed. Per-image predictions are absent from the saved archive, so these downloads alone cannot reproduce AP.

Targets versus requirements

The historical 100 ms / 15 FPS timing targets and 1.0-point AP-loss target were experiment choices. No application-derived acceptance criteria were supplied. A deployment needs its own end-to-end latency and task-quality requirements.

The original report retains historical target-based classifications for provenance; these are not validated capacity claims. The 2,753-check audit verifies identities and arithmetic, not independent reproduction. Exploratory paired log-ratio t-intervals assume approximately independent normal round log ratios and do not establish multi-day repeatability.

06

BROWSER DEMONSTRATION

Try the detector.

ONNX FP32 runs on your device. Its FPS and latency describe your browser, separate from the Kaggle study. Browser tracking uses IoU/centroid association, separate from Python ByteTrack.

Processing & assets ↗
E18 / LYSAKER, NORWAYREADY TO INITIALIZE
▶A real model. Your device.Press Run demo to load the model and begin.
LOCAL INFERENCE · VIDEO STAYS ON DEVICE
00:00 / 00:30Ready. Model loads only when you start.
30 continuous seconds · E18, Lysaker, Norway · Kjetil_r / public domain.VEHICLES ONLY

Boxes and IDs update at up to 15 detections/second while video playback remains independent. Simple browser tracking estimates crossings; counting accuracy has not been validated.