Download Resume
Approach
YOLOv8 with model.track() (BoT-SORT by default), applied to real traffic video clips.
results = model.track(frame, persist=True, verbose=False, conf=0.15)
# no tracker= argument passed, so Ultralytics uses its default: BoT-SORT
# result.boxes.id gives persistent track IDs across frames

Persistent IDs mean I can count unique vehicles that passed through a clip, not just re-detect (and over-count) the same vehicle in every frame it's visible. No tracker= argument is passed to model.track(), so this runs on Ultralytics' default, BoT-SORT, not ByteTrack — BoT-SORT extends ByteTrack's association logic with camera-motion compensation and optional re-ID.

Built

Results: across the 5 demo clips below, unique-object counts range from 0 (Clip 3, the deliberate anomaly test) to 279 across a 1,709-frame clip (Clip 5) — full per-clip class breakdowns are in each clip's own terminal output.

These are unique track IDs, not a verified physical count — an upper bound, not ground truth. If a vehicle is occluded and the tracker loses and reacquires it, it gets assigned a new ID and is counted twice. Production-grade counting systems typically use line-crossing or zone-crossing logic instead: even a track that fragments into multiple IDs only crosses the counting line once, so fragmentation doesn't inflate the count.
Motorcycles initially didn't appear in the counts — not a detection failure, a filtering oversight: the class-filter dict simply didn't include COCO class ID 3 (motorcycle). Fixing it also required lowering conf from the 0.25 default, since motorcycles are underrepresented relative to cars in COCO's training data and typically score lower confidence.
Demo Clips
Five tracked clips. Clips 1, 2, 4, and 5 are real traffic footage. Clip 3 is a deliberate anomaly test: a random video of oranges dropping, thrown at the same tracker to see whether it would find anything in a scene it wasn't built for. It found nothing — the correct, honest result. "Orange" is actually one of COCO's own 80 classes, so this wasn't a rigged test either; the model still came up empty, which is the same lesson as Level 3's aerial photo in a new form: a model is only as good as how well the actual footage matches its training distribution, not just whether a class exists in its vocabulary.
1

Terminal output

traffic1.mp4 -> Processed 796 frames
Unique vehicles tracked, by class:
  person: 17 unique  (peak 6 simultaneously in frame)
  car: 43 unique  (peak 10 simultaneously in frame)
  motorcycle: 0 unique  (peak 0 simultaneously in frame)
  bus: 6 unique  (peak 2 simultaneously in frame)
  truck: 18 unique  (peak 2 simultaneously in frame)
  Total: 84 unique objects
Saved annotated video as output_tracked1.mp4
2

Terminal output

traffic2.mp4 -> Processed 910 frames
Unique vehicles tracked, by class:
  person: 13 unique  (peak 4 simultaneously in frame)
  car: 18 unique  (peak 7 simultaneously in frame)
  motorcycle: 0 unique  (peak 0 simultaneously in frame)
  bus: 8 unique  (peak 3 simultaneously in frame)
  truck: 9 unique  (peak 2 simultaneously in frame)
  Total: 48 unique objects
Saved annotated video as output_tracked2.mp4
3 Anomaly test

Terminal output

traffic3.mp4 -> Processed 356 frames
Unique vehicles tracked, by class:
  person: 0 unique  (peak 0 simultaneously in frame)
  car: 0 unique  (peak 0 simultaneously in frame)
  motorcycle: 0 unique  (peak 0 simultaneously in frame)
  bus: 0 unique  (peak 0 simultaneously in frame)
  truck: 0 unique  (peak 0 simultaneously in frame)
  Total: 0 unique objects
Saved annotated video as output_tracked3.mp4
4

Terminal output

traffic4.mp4 -> Processed 525 frames
Unique vehicles tracked, by class:
  person: 4 unique  (peak 2 simultaneously in frame)
  car: 10 unique  (peak 8 simultaneously in frame)
  motorcycle: 0 unique  (peak 0 simultaneously in frame)
  bus: 3 unique  (peak 2 simultaneously in frame)
  truck: 0 unique  (peak 0 simultaneously in frame)
  Total: 17 unique objects
Saved annotated video as output_tracked4.mp4
5

Terminal output

traffic5.mp4 -> Processed 1709 frames
Unique vehicles tracked, by class:
  person: 66 unique  (peak 11 simultaneously in frame)
  car: 162 unique  (peak 13 simultaneously in frame)
  motorcycle: 2 unique  (peak 1 simultaneously in frame)
  bus: 7 unique  (peak 3 simultaneously in frame)
  truck: 42 unique  (peak 3 simultaneously in frame)
  Total: 279 unique objects
Saved annotated video as output_tracked5.mp4