NOTEBOOKS

Tutorial notebooks

Tutorial notebooks

A seven-notebook tour of unitrack 2.0. Each notebook is self-contained; read in order if new to the library, or jump to a specific topic.

#NotebookTopic
1QuickstartBuild & run a minimal tracker. Visualize trajectories.
2Data modelThe five typed records: Tracklets, Detections, FrameContext, CostExpression, MatchOutcome, plus the Gate algebraic variant.
3Costs and gatesThe full cost zoo (Cosine, CDist, BiSoftmax, RBF, IoU family, Mahalanobis) and gate zoo (Class, Score, Spatial, Motion). With heatmaps.
4Pipeline treeComposable stage tree: Pipe, Sequential, Parallel, Gated, Filter, Iterate. Cascaded vs parallel fusion.
5States and lifecycleState evolution (Process × Observation), Kalman, EMA. Lifecycle (Tentative → Active → Lost → Removed).
6Cascaded and parallelK=2 cascaded and parallel-fusion configurations compared end-to-end on synthetic data with known ground truth.
7MigrationMigrate a 1.x tracker to 2.0 and showcase the new possibilities (parallel fusion, cascaded matching, lifecycle, differentiable matching) — driven by a real pretrained detector.

Notebooks are generated from _build.py in this directory; edit the NB_* cell lists there, re-run it, then execute the notebook to refresh outputs. Edit the lists, not the .ipynb files directly — regenerating overwrites them, outputs included.

What's not covered

The tutorials focus on the core library. For these specialized paths, look at:

  • Multi-stream / batched tracking — unitrack.tracker.BatchTracker (vmap-batched). See its tests in tests/unitrack/tracker/test_batch_tracker.py.
  • Clip-based inference (MinVIS, DVIS++ patterns) — unitrack.tracker.ClipTracker.
  • Differentiable tracking — Tracker(differentiable=True) swaps in soft companions automatically.
  • Real Optuna sweep on Mask2Former-Cityscapes detections — examples/hpo_sweep/.