The Nearest Blob Is the Wrong Blob
A tracker that remembers only the last location looks excellent right up until a distractor crosses the target. Then recency turns into an identity-swap machine.
distractrack generates a 42-frame crossing sequence with measurement noise and a deliberate occlusion jump, and both trackers receive exactly the same candidates.
Memory Needs Identity and Motion
The baseline picks the candidate nearest its last position. The distractor-aware tracker predicts motion and is supposed to resist the swap. It works at the coordinate level on purpose, to isolate the memory policy from segmentation quality.
The Number
Recency memory tracks 73.8% of frames correctly after the crossing. The distractor-aware tracker, as published, tracks 100%, a 26.2-point gain. Read the next section before you quote that.
The Motion Model Never Actually Ran
The aware tracker's score was distance_to_prediction + 3 × (1 − is_target), and is_target was the ground-truth label, handed straight to the scoring function. A flat penalty of 3 on the distractor swamps any realistic distance, so the velocity term never got a vote. Across 60 seeds, accuracy was exactly 1.0 every time.
Remove only the label term and the tracker picks the same candidate as plain recency on 41 or 42 of every 42 frames. Mean gain over recency: exactly 0.0. The motion model the repo is built around contributed nothing. All 26.2 points were the answer key.
The fix keeps the velocity model and adds one label-free rule: when the two candidates sit close together, an ambiguous crossing where either pick is defensible, coast on the previous velocity estimate instead of letting a noisy pick corrupt it. That recovers a real, never-negative gain of 2.8 points across 60 tuning seeds and 1.7 on a disjoint 30-seed holdout, evaluated once.
It's small for an honest reason. After the crossing, the distractor moves in exact lockstep with the target, so motion alone genuinely can't tell them apart. That's the lesson worth keeping: a tracker that survives crossings needs an appearance cue, the thing the cited SAM2 work actually adds, not a cleverer motion model. The original module is untouched, and 10 tests pass on GitHub Actions across Python 3.9 through 3.13.
Research Basis
Inspired by CVPR 2025's distractor-aware SAM2 memory paper. Every number on this page comes from this repository's own controlled benchmark, not from the paper.
Try It
Standard library only:
git clone https://github.com/ahmeddoghri/distractrack && cd distractrack
python distractrack.py # the published 100%, label term included
python distractrack_v2.py # label-free with coasting: 73.8% → 85.7% on the published seed
python eval_v2.py # 90 seeds: oracle ~25 points, motion alone 0, with coasting ~2