Add How to Add ReID to Trackers notebook - #449
Conversation
Port the MOT17 BoT-SORT appearance-ReID tutorial from roboflow/trackers as a starting point for the Roboflow notebooks collection. Co-authored-by: Cursor <cursoragent@cursor.com>
Focus the tutorial on BoT-SORT + ReID usage, trim helper/histogram code, and add the notebook to the tracker tutorials table. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
BoxAnnotator/LabelAnnotator default to class colors, but MOT preds have no class_id. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Fixed sample-frame viz: set |
|
Updated notebook links to official docs hosts ( |
Use trackers.roboflow.com and reid.roboflow.com instead of GitHub blob paths where docs exist. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the trackers ReID appearance guide URL as the intended docs path; package and training refs can use the re-ID repo until docs sites are fully live. Co-authored-by: Cursor <cursoragent@cursor.com>
Point the closing link at PR roboflow#449 instead of a main-branch Colab URL that is not published yet. Co-authored-by: Cursor <cursoragent@cursor.com>
0.25 is the BoT-SORT / trackers default appearance threshold; keep paper references for the published MOT tables only. Co-authored-by: Cursor <cursoragent@cursor.com>
0.25 is the BoT-SORT / trackers default appearance threshold; keep paper references for the published MOT tables only. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
Adds a new tracker-focused tutorial notebook showing how to enable and evaluate appearance ReID with BoT-SORT via the trackers[reid] extra, and registers it in the repo’s notebook listings.
Changes:
- Added a new Colab-oriented notebook: “How to Add ReID to Trackers” (BoT-SORT + ReID on MOT17 val-half, plus appearance-distance diagnostics).
- Updated the tracker tutorials section in
README.mdto include the new notebook and update the notebook count. - Registered the notebook in
automation/notebooks-table-data.csvfor automated table generation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| README.md | Updates the tracker tutorials table/count and adds the new notebook link. |
| notebooks/how-to-add-reid-to-trackers.ipynb | New end-to-end tutorial notebook for BoT-SORT + ReID, evaluation, and diagnostics. |
| automation/notebooks-table-data.csv | Adds a new row so the notebook is included in generated tables. |
Comments suppressed due to low confidence (2)
notebooks/how-to-add-reid-to-trackers.ipynb:670
- This outro also links to
https://trackers.roboflow.com/latest/learn/reid/(noted in the PR description as currently 404). Consider removing the link or marking it as coming soon until the docs deploy is live.
"Ready to go deeper? Explore the [ReID appearance guide](https://trackers.roboflow.com/latest/learn/reid/),\n",
notebooks/how-to-add-reid-to-trackers.ipynb:353
- This block depends on
_MOTOutputto write predictions. To avoid relying on privatetrackersinternals, write the MOTChallenge prediction file directly here. While touching this line, usingframe=frame(keyword) matches the notebook text and is more resilient to signature changes than a positional argument.
" with _MOTOutput(pred_dir / f\"{seq}.txt\") as out:\n",
" for frame_idx in range(1, spec[\"n_frames\"] + 1):\n",
" frame = cv2.imread(str(images[frame_idx - 1]))\n",
" tracked = tracker.update(dets.get(frame_idx, sv.Detections.empty()), frame)\n",
" if tracked.tracker_id is not None:\n",
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "For threshold selection and MOT17 / SoccerNet results, see the\n", | ||
| "[ReID appearance guide](https://trackers.roboflow.com/latest/learn/reid/)." |
| "from pathlib import Path\n", | ||
| "\n", | ||
| "REPO_ROOT = Path(\"..\")\n", | ||
| "\n", | ||
| "VAL_SEQUENCES = [\n", |
| "from trackers import BoTSORTTracker\n", | ||
| "from trackers.eval import evaluate_mot_sequences\n", | ||
| "from trackers.io.frames import load_mot_frame_image\n", | ||
| "from trackers.io.mot import _MOTOutput, load_mot_file\n", | ||
| "\n", |
| "!pip install -q matplotlib gdown\n", | ||
| "!pip install -q \"trackers[reid] @ git+https://github.com/roboflow/trackers.git@feat/core/reid-consume-reid-package\"\n" |
The negative pool filled in sequence order and stopped at its cap, so every different-ID pair came from MOT17-02 frames 1 to 13 while same-ID pairs spanned all seven sequences. Same-ID pairs were also weighted by track length. Draw pairs directly with an equal quota per sequence and a uniform identity choice, and reject zero-frame gaps so a crop cannot pair with itself. At theta=0.2 the table now reports 67.9% same-ID and 1.1% different-ID instead of 77% and 1%. Co-authored-by: Cursor <cursoragent@cursor.com>
The histogram fixes one frame gap, so it says nothing about how far the threshold can be trusted for re-finding a lost track. Sweep the gap instead and report quantile bands plus ROC AUC, which needs no true-positive or false-positive target. At theta=0.2 appearance helps 98% of same-ID pairs one frame apart but only 52% across the default 30-frame lost-track buffer, while the different-ID rate stays near 1% at every gap. Co-authored-by: Cursor <cursoragent@cursor.com>
The sweep figure labelled its lower panel "ROC AUC" against an unexplained line at 0.5, giving no clue which direction was good. Label the axis with what the statistic is, the chance a random same-ID pair scores closer than a random different-ID pair, annotate each point, and mark 0.5 as chance inline. Co-authored-by: Cursor <cursoragent@cursor.com>
The legend carried six entries and two different percentile bands, so reading the two classes meant holding two conventions at once. Use one symmetric 10th to 90th band for both, fold each band into its line to leave four entries, and name the axes "appearance distance" and "separability" instead of their formulas. Co-authored-by: Cursor <cursoragent@cursor.com>
The AUC panel sits under the two shaded bands and shares their x-axis, which reads as though it summarises where they cross. It does not: at a 1-frame gap the bands never touch yet the AUC is 0.998. Spell out that the statistic draws one pair from each class and counts every sampled pair, tails included. Co-authored-by: Cursor <cursoragent@cursor.com>
The notebook defined the statistic but never justified choosing it, leaving the reader to guess it summarised the shaded overlap. State that it is the area under the curve traced by sweeping theta and plotting the two printed rates, and that its complement is how often a same-ID pair sits farther apart than a different-ID one. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
trackers[reid]and thereidpackageautomation/notebooks-table-data.csvand regenerates the tracker tutorials table inREADME.mdPR checklist
trackersships a release with the ReID extra (expectedtrackers[reid]==2.6.0or similar), switch the install cell from the git pin (feat/core/reid-consume-reid-package) to the PyPI extraTest plan
Docs / release checklist
reidpackage links currently point at GitHub (https://github.com/roboflow/re-ID); that is fine. Optionally switch training-guide links toreid.roboflow.comonce that docs site is live