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 1 commit 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 1 commit intodevelopfrom
feat/cli/tune-hyperparameter-optimization

Conversation

@SkalskiP
Copy link
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
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