AI and ML Network Blog

Multi-Object Video Tracking Annotation Guide for MOT, ByteTrack & BoT-SORT

Build clean MOT17/MOT20 video tracking datasets for ByteTrack, BoT-SORT, and OC-SORT. Master ID persistence, occlusion rules, and Python MOT QA scripts.

October 30, 2026 Updated November 25, 2026 Onidul Islam Siyam Onidul Islam Siyam 11 min read Advanced
Video Annotation MOT Tracking ByteTrack BoT-SORT CVAT

The Short Answer

Building reliable Multi-Object Tracking (MOT17/MOT20) ground truth for ByteTrack, BoT-SORT, and OC-SORT requires far more discipline than frame-by-frame object detection. Every annotated sequence must enforce exact 1-based 10-column MOT .txt formatting, unambiguous track ID persistence across occlusions, tight keyframe spacing on nonlinear motion, and strict visibility scoring. Even a handful of broken IDs, duplicate (frame, id) rows, or lazy linear-interpolated boxes will distort HOTA, IDF1, and ID Switches (IDSW)—causing engineering teams to misdiagnose tracker hyperparameters when the real culprit is corrupted sequence ground truth.

How ByteTrack, BoT-SORT, and OC-SORT Actually Use Your Annotations

Most production tracking pipelines decouple detection from association (tracking-by-detection), yet they rely on clean MOT sequences in three critical ways:

  1. Detector fine-tuning on occluded low-score objects: ByteTrack’s core breakthrough is associating low-confidence detections (0.1–0.5) during occlusion rather than discarding them. If your annotators stop labeling partially occluded pedestrians or vehicles once they fall below 50% visibility, your detector never learns to fire weak boxes during overlap—neutralizing ByteTrack’s second-stage matching completely.
  2. Re-ID appearance encoder training (BoT-SORT / StrongSORT): Trackers with appearance embeddings extract cropped image patches grouped by track_id. If annotators accidentally swap track IDs when two forklifts or pedestrians cross paths, you feed wrong positive identity pairs straight into triplet or cross-entropy Re-ID loss.
  3. Tracker benchmarking and hyperparameter tuning (HOTA, MOTA, IDF1, IDSW): Tuning track_high_thresh, track_buffer, match_thresh, and Kalman noise weights (std_weight_position, std_weight_velocity) is meaningless if your ground-truth .txt file contains drifting interpolated boxes or fragmented IDs.

For teams scaling CCTV traffic analytics, retail footfall counting, or warehouse fleet monitoring, structured video annotation paired with strict sequence QA separates production-grade tracking from noisy demo metrics.

Exact 10-Column MOT17/MOT20 .txt Schema Breakdown

Unlike YOLO (normalized center coordinates) or COCO JSON (0-based pixel arrays), the MOTChallenge standard stores every sequence in a single comma-separated gt.txt file using 1-based frame indices, 1-based track IDs, and absolute top-left pixel coordinates.

Column #Field NameData TypeExact MOT17 / MOT20 Specification & Gotchas
1frameInteger (>= 1)1-based video frame number. Exporting 0-based frames from custom OpenCV scripts breaks TrackEval silently or shifts every frame by 1.
2idInteger (>= 1)Globally unique object identity within the sequence. Set to -1 only in detection-only det.txt files—never in ground-truth gt.txt.
3bb_leftFloat (px)Top-left X pixel coordinate. Can be slightly negative if unclipped, but check whether your evaluation loader clips to [0, W-1].
4bb_topFloat (px)Top-left Y pixel coordinate. Must stay strictly aligned with frame height H.
5bb_widthFloat (> 0)Box width in pixels. Zero or negative widths crash IoU association matrices.
6bb_heightFloat (> 0)Box height in pixels. Must remain tightly fitted—same pixel-tight rules as bounding box annotation.
7confBinary (0 or 1)In gt.txt, 1 means active ground truth evaluated by metrics; 0 means ignore region (e.g., distractor crowd or reflection zone).
8class_idInteger (>= 1)MOT class index (e.g., 1=pedestrian, 2=vehicle, 7=static_person, 8=distractor in MOT17; custom contiguous IDs in proprietary datasets).
9visibilityFloat (0.0–1.0)Estimated fraction of the object visible (1.0 = fully visible, 0.4 = 60% occluded). Evaluators filter tracks below minimum visibility thresholds.
10z / unusedFloat (-1)Optional 10th column preserved for 3D world-coordinate MOT compatibility (x, y, z in MOT15/16); fill with -1 when unused if your parser expects 10 columns.

A valid snippet of 10-column MOT ground truth for two vehicles moving through a CCTV intersection looks like this:

1,1,412.50,288.10,146.20,94.80,1,2,1.00,-1
1,2,890.00,310.40,118.60,82.00,1,2,0.85,-1
2,1,418.10,289.00,147.00,95.10,1,2,1.00,-1
2,2,882.40,312.00,119.10,82.40,1,2,0.60,-1
3,1,424.00,290.20,147.60,95.40,1,2,1.00,-1
3,2,874.80,313.50,119.50,82.80,1,2,0.35,-1

Notice how track 2 smoothly drops in visibility (0.85 -> 0.60 -> 0.35) as it passes behind a road sign while keeping id=2 intact.

Occlusion, Crossing, and Re-Entry ID Persistence Rules

Ninety percent of real-world MOT ground-truth defects come from annotators improvising during occlusions. Every tracking project must lock down a written ID Persistence Policy Table before frame 1 is labeled:

Visual EventTrack ID PolicyBox & Visibility RuleImpact on IDF1 / HOTA / IDSW
Partial Occlusion (20%–75% hidden)Keep original ID continuouslyLabel amodal (full estimated extent) or modal (visible portion only)—pick ONE standard globally and score visibility accuratelyConsistent rules let ByteTrack learn low-conf overlap recovery without erratic IoU drops
Brief Full Occlusion (< 2–3 sec behind pole/car)Keep original ID when object re-emerges; mark outside=true in CVAT while 100% invisibleDo not draw phantom boxes while 100% hidden (unless benchmarking amodal trackers); resume exact original track_id on the first visible pixelPrevents artificial ID switches when BoT-SORT or OC-SORT bridges short gaps via track_buffer
Two Identical Objects Crossing PathsScrub frame-by-frame (1 fps step) through the crossover; maintain true physical IDsNever rely on auto-interpolation across a crossing—verify clothing, license plate, wheel rim, or stride phaseEliminates fatal Re-ID label swaps that poison BoT-SORT appearance embeddings
Full Exit & Later Camera Re-EntryStandard MOT: Assign new ID. Multi-camera / Re-ID benchmark: Keep original IDDocument the rule explicitly in seqinfo.ini and QA guidelines; never mix both conventions in one datasetMixing new-ID and same-ID policies makes IDF1 impossible to interpret reliably
Heavy Crowd / Unresolvable Distant ClusterLabel boundary as conf=0 ignore region (distractor zone)Prevents false-positive penalties where human reviewers cannot distinguish individuals reliablyStabilizes MOTA and prevents detector suppression on cluttered backgrounds

On vehicle CCTV tracking engagements like our work for Fastview360 (UK)—which combined 2D/3D vehicle bounding boxes and structural tracking inside client workspaces—consistent crossover verification and tight boundary rules across multi-lane traffic were essential to keeping downstream speed and safety analytics accurate. You can inspect that engagement overview on our portfolio page.

Keyframe Interpolation Intervals vs. Fast Nonlinear Motion in CVAT

Keyframe interpolation in CVAT, Encord, or Supervisely is the biggest lever for controlling video object tracking annotation pricing—and simultaneously the #1 source of invisible localization drift.

If you are still selecting your labeling platform for sequence tracks, compare CVAT’s native interpolation tracks against Roboflow and Label Studio in our CVAT vs. Label Studio vs. Roboflow breakdown.

Follow these empirical keyframe spacing rules instead of a lazy fixed interval:

  • Static CCTV camera, steady highway/corridor motion (25–30 FPS): Keyframes every 10 to 15 frames typically hold within < 3 px drift, provided the camera has zero pan/tilt/zoom (PTZ) movement.
  • Fast nonlinear acceleration, sharp turns, sports, or drone tracking: Tighten keyframes to every 2 to 5 frames (or every frame during sudden deceleration/impact). Linear interpolation cuts straight chords across curved trajectories, sliding boxes completely off fast-moving limbs or turning vehicles.
  • Hand-held, body-cam, or PTZ camera motion: Disable long interpolation spans completely. Global camera shake moves every object nonlinearly between adjacent frames; either run optical-flow assisted tracking with 3-frame human verification or pre-stabilize/use BoT-SORT’s Global Motion Compensation (GMC) reference checks.
  • Scale transitions (approaching/receding targets): Perspective foreshortening expands box area quadratically as a vehicle approaches the lens. Place extra keyframes during the final 30 frames before frame exit so bb_width and bb_height never lag behind perspective growth.

Auditing ID Switches (IDSW), IDF1, and Track Integrity with Python

Never hand an exported MOT gt.txt straight to TrackEval or a Re-ID trainer without running an automated structural validator first. Manual exports from CVAT or custom format converters routinely harbor silent bugs: duplicate (frame, id) rows from merged tasks, negative box widths, boxes drifting past image width/height, single-frame orphan tracks from accidental clicks, and impossible pixel “teleports” indicating a swapped track ID.

Run this lightweight Python MOT QA script on every exported sequence before training or benchmarking:

from collections import defaultdict
from pathlib import Path
import math


def validate_mot_gt(gt_path: str, img_w: int, img_h: int, max_jump_px: float = 180.0, min_len: int = 3):
    issues = defaultdict(list)
    seen, tracks = set(), defaultdict(list)

    for ln, raw in enumerate(Path(gt_path).read_text().splitlines(), start=1):
        if not raw.strip():
            continue
        p = [x.strip() for x in raw.split(",")]
        if len(p) < 9:
            issues["malformed_columns"].append(ln)
            continue

        frame, tid = int(float(p[0])), int(float(p[1]))
        x, y, w, h = map(float, p[2:6])
        conf, cls_id, vis = float(p[6]), int(float(p[7])), float(p[8])

        if frame < 1 or tid < 1:
            issues["invalid_frame_or_id"].append((ln, frame, tid))
        if (frame, tid) in seen:
            issues["duplicate_frame_id"].append((ln, frame, tid))
        seen.add((frame, tid))

        if w <= 1.0 or h <= 1.0:
            issues["degenerate_box"].append((ln, frame, tid))
        if x < -5.0 or y < -5.0 or (x + w) > img_w + 5.0 or (y + h) > img_h + 5.0:
            issues["out_of_bounds"].append((ln, frame, tid))
        if not (0.0 <= vis <= 1.0) or conf not in (0.0, 1.0):
            issues["invalid_vis_or_conf"].append((ln, frame, tid, vis, conf))

        tracks[tid].append((frame, x + w / 2.0, y + h / 2.0, cls_id))

    for tid, obs in tracks.items():
        obs.sort(key=lambda r: r[0])
        if len(obs) < min_len:
            issues["suspicious_short_track"].append((tid, len(obs)))
        if len({r[3] for r in obs}) > 1:
            issues["class_flip_mid_track"].append(tid)
        for i in range(1, len(obs)):
            dt = max(1, obs[i][0] - obs[i - 1][0])
            dist = math.hypot(obs[i][1] - obs[i - 1][1], obs[i][2] - obs[i - 1][2])
            if (dist / dt) > max_jump_px:
                issues["possible_id_swap_teleport"].append((tid, obs[i - 1][0], obs[i][0], round(dist, 1)))
    return dict(issues)


if __name__ == "__main__":
    res = validate_mot_gt("seq01/gt/gt.txt", img_w=1920, img_h=1080)
    print("PASS" if not res else {k: len(v) for k, v in res.items()})

The final temporal loop (class_flip_mid_track and possible_id_swap_teleport) catches the vast majority of costly human ID swaps and accidental mid-track class flips in seconds—before you ever start training.

Production QA Workflow for Multi-Camera and High-Density Tracking

Automated scripts verify structural hygiene, while structured human review catches occlusion drift and identity crossovers across three mandatory gates:

  1. Pre-Label Sequence Calibration: Label 200 dense frames first to freeze modal vs. amodal box rules, occlusion thresholds, and conf=0 ignore zones inside a 2-page visual rubric.
  2. Real-Time Playback Review (1.0x and 0.5x): Never QA MOT sequences purely as static images. Color-coded track_id playback exposes lagging interpolation, flickering edges, and sudden ID color flashes immediately.
  3. Cross-Boundary Task Seam Audit: When chunking long videos into 500-frame CVAT tasks for parallel annotators, overlap chunks by 10 frames and run an automated + human ID stitching pass across boundaries—otherwise every 500th frame triggers a wave of false ID switches.

Scaling Video Tracking QA Without Breaking Your Pipeline

High-density MOT annotation is notoriously unforgiving: cheap crowdsourced labeling burns engineering weeks chasing phantom ID switches and unstable HOTA scores. At AI and ML Network, our video QA specialists work natively inside your existing CVAT, Roboflow, Encord, or Supervisely workspace under NDA—delivering validated MOT17/MOT20, YOLO, or COCO-VID tracks with strict occlusion continuity and automated integrity checks built in.

Start with a low-risk calibration clip pilot (300 to 1,000 frames of your hardest occlusion footage) so your engineering team can validate track smoothness and IDF1 alignment firsthand. Share your FPS, target tracker, and clip specs through our project scoping form or message us via our contact page.

Frequently Asked Questions

What is the exact column layout of the MOT17 and MOT20 annotation format? +

Standard MOT ground truth files use a 9-column or 10-column comma-separated plain-text schema: frame, track_id, bb_left, bb_top, bb_width, bb_height, conf, class_id, and visibility—with MOT16 and legacy 3D tracks sometimes padding a 10th column set to -1. Frame indices and track IDs are strictly 1-based positive integers.

Should an occluded object keep the same track ID when it reappears behind an obstacle? +

Yes, for short-to-medium occlusions within the same camera view where human reviewers can confirm identity continuity, the object must keep its original track_id. If a person or vehicle leaves the camera field of view completely and returns later, define a clear camera-re-entry policy up front—most MOT benchmarks assign a new ID unless evaluating explicit Re-ID models.

Why does linear keyframe interpolation in CVAT corrupt ByteTrack and BoT-SORT evaluation? +

Linear interpolation assumes constant pixel velocity between keyframes. During camera panning, sudden braking, sharp turns, or zoom changes, interpolated boxes drift off the true object centroid—artificially inflating Kalman filter innovation error and penalizing accurate trackers with false ID switches and lower HOTA scores.

How do BoT-SORT and OC-SORT differ from ByteTrack in what annotation flaws hurt them most? +

ByteTrack relies purely on motion and low-confidence box association, so loose boxes or dropped occluded frames directly break its two-stage IoU matching. BoT-SORT adds camera motion compensation and Re-ID appearance features, making inconsistent track IDs across occlusions and background-bleed crops especially damaging to Re-ID training.

Work With AI and ML Network

Need help with annotation, QA, or AI model evaluation?

Share your dataset, model objective, or evaluation criteria. We work inside your preferred platform and scope a clear pilot before production.