Skip to content

fix(tune): accept MOT-layout ground truth in Tuner validation - #563

Draft
AlexBodner wants to merge 1 commit into
developfrom
fix/tuner-mot-layout-gt
Draft

fix(tune): accept MOT-layout ground truth in Tuner validation#563
AlexBodner wants to merge 1 commit into
developfrom
fix/tuner-mot-layout-gt

Conversation

@AlexBodner

Copy link
Copy Markdown
Collaborator

Problem

Tuner passes gt_dir straight to evaluate_mot_sequences, which auto-detects both the flat {seq}.txt layout and the {seq}/gt/gt.txt layout that MOTChallenge, DanceTrack and SportsMOT ship in.

Eager validation only looked for the flat layout, so a freshly downloaded dataset was rejected at construction with Missing ground-truth files even though evaluation would have read it fine. The workaround was flattening the tree by hand.

Fix

Validation detects the layout with the same helper evaluation uses, so the two cannot drift apart, and missing files are reported at the path actually searched.

_get_paths is split so the ground-truth path rule lives in one place instead of being restated in the tuner.

Tests

  • A MOT-layout tree initializes (raised FileNotFoundError before the change).
  • A sequence missing from a MOT-layout tree is reported at its MOT path, not the flat one.
  • The flat layout still reports missing files at the flat path.

tests/tune, tests/eval and tests/io pass at 171.

Notes

Sequence discovery already reads the detections directory, which is always flat, so only ground-truth resolution needed changing.

These tests were skipping locally because optuna (the tune extra) was not installed — worth confirming CI installs it, otherwise this whole file is silently skipped.

Made with Cursor

`Tuner` passes `gt_dir` straight to `evaluate_mot_sequences`, which
auto-detects both the flat `{seq}.txt` layout and the `{seq}/gt/gt.txt`
layout that MOTChallenge, DanceTrack and SportsMOT ship in. Eager
validation only looked for the flat layout, so a downloaded dataset was
rejected at construction with "Missing ground-truth files" even though
evaluation would have read it fine. The workaround was to flatten the
tree by hand.

Validation now detects the layout with the same helper evaluation uses, so
the two cannot drift apart, and missing files are reported at the path
actually searched.

`_get_paths` is split so the ground-truth rule lives in one place rather
than being restated in the tuner.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Borda
Borda requested a balanced review from Copilot August 12, 2026 18:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Aligns Tuner ground-truth validation with evaluation’s flat and MOT directory layouts.

Changes:

  • Extracts shared ground-truth path resolution.
  • Uses format detection during tuner validation.
  • Adds regression tests for both layouts and missing-file paths.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/trackers/eval/evaluate.py Extracts shared ground-truth path helper.
src/trackers/tune/tuner.py Validates ground truth using detected layout.
tests/tune/test_tuner.py Adds layout validation tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/tune/test_tuner.py
that would evaluate fine.
"""

def test_accepts_mot_layout_ground_truth(self, tmp_path: Path) -> None:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants