YOLOv8 with model.track() (BoT-SORT), applied to real traffic video. Persistent IDs instead of re-detecting the same vehicle every frame.
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 framesPersistent 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.
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.
conf from the 0.25 default, since motorcycles are underrepresented relative to cars in COCO's training data and typically score lower confidence.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.mp4Terminal 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.mp4Terminal 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.mp4Terminal 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.mp4Terminal 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