Skip to content

Add a trackers tune CLI subcommand that runs hyperparameter optimization for any registered tracker using Optuna.#291

Draft
SkalskiP wants to merge 3 commits intodevelopfrom
feat/cli/tune-hyperparameter-optimization
Draft

Add a trackers tune CLI subcommand that runs hyperparameter optimization for any registered tracker using Optuna.#291
SkalskiP wants to merge 3 commits intodevelopfrom
feat/cli/tune-hyperparameter-optimization

Conversation

@SkalskiP
Copy link
Copy Markdown
Collaborator

Stage 1: Search Space Definitions

  • Added search_space: ClassVar[dict[str, dict]] to SORTTracker and
    ByteTrackTracker
  • Added validation in BaseTracker.__init_subclass__ ensuring every search_space key
    matches an __init__ parameter
  • search_space is optional (trackers without it still work)

Stage 2: Tuner Class + Objective Function

  • Tuner class that wraps Optuna and an internal objective function
  • Update pyproject.toml with optuna as optional dependency under trackers[tune]
  • Run evaluation with evaluate_mot_sequences from trackers/eval/evaluate.py
  • Each trial calls tracker reset() method
  • Tuner.run() creates Optuna study, runs trials, returns best params dict

Stage 3: CLI Subcommand

  • Wire Tuner into trackers tune subcommand following trackers eval pattern
  • CLI arguments: --tracker, --gt-dir, --detections-dir, --objective, --n-trials, --output

Target Usage

# Basic usage
trackers tune \
  --tracker bytetrack \
  --gt-dir path/to/gt/ \
  --detections-dir path/to/detections/ \
  --n-trials 100

# With custom objective
trackers tune \
  --tracker sort \
  --gt-dir path/to/gt/ \
  --detections-dir path/to/detections/ \
  --objective HOTA \
  --n-trials 200

* add search spaces in trackers

* add validation

* add tests

* update search spaces and fixes

* remove unnecessary tests

* fix errors
@SkalskiP SkalskiP marked this pull request as draft February 24, 2026 11:37
…rparameter-optimization

Made-with: Cursor

# Conflicts:
#	trackers/core/bytetrack/tracker.py
@SkalskiP
Copy link
Copy Markdown
Collaborator Author

SkalskiP commented Mar 9, 2026

@omkar-334 I updated this branch to make it up to date before #301 merging.

@omkar-334
Copy link
Copy Markdown
Contributor

hey @SkalskiP can you update this branch? I think my tuning experiment will get similar numbers because of #323 and #323 being merged. Did you get a chance to review my PR? #301

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