Skip to content

Contributing Guide

Start with a source checkout and the development dependencies:

git clone https://github.com/mikel-brostrom/boxmot.git
cd boxmot
pip install "uv==0.12.4"
uv sync --extra cpu --extra yolo --extra evolve --extra service \
  --group dev --group test --group docs
uv run --no-sync python -m boxmot.engine.cli --help

Use your fork's URL when contributing through a fork. Replace cpu with cu130 for CUDA 13.0, and repeat the selected extras on later syncs. Create a short branch such as docs/update-examples, keep changes focused, and include the exact tests you ran in the pull request.

Where code belongs

The main extension surfaces are:

  • canonical data values under boxmot/structures and reusable component composition under boxmot/pipelines
  • detector and segmentor implementations under boxmot/detectors and boxmot/segmentors

  • algorithm packages under boxmot/trackers/<name>, with shared support code under boxmot/trackers/common and representation families declared in capability metadata

  • native C++ sources and low-level ABI bindings under boxmot/native, with Python-facing adapters beside their tracker or ReID domain implementation
  • canonical packaged configuration under boxmot/configs
  • application orchestration under the owning boxmot/engine subsystem (tracking, materialization, eval, calibration, tuning, service, or commands), with command presentation and Rich progress isolated in boxmot/engine/ui; there is no generic workflow or boxmot.api layer
  • reusable ReID backbones, backends, datasets, training, and exporters under boxmot/reid, with CLI command orchestration under boxmot/engine/commands/reid
  • dependency-light downloads and local model-path resolution under boxmot/resources; renderers integrate through callbacks, so resources never import the engine UI

boxmot/utils is deliberately limited to cross-domain checks, configuration primitives, logging/constants, and Torch device helpers. Put new helpers beside the subsystem that owns their behavior instead of rebuilding a generic misc module.

The engine root contains cli.py and its package initializer. Shared workflow configuration lives in boxmot/engine/config/: runtime.py owns mode defaults and argument normalization, experiments.py resolves authored experiments, and trackers.py applies workflow-specific tracker overrides. ReID command argument mapping belongs in reid.py; recipe/default/override precedence lives in reid_presets.py. Import directly from these modules; the configuration namespace stays lightweight.

Reusable ReID training settings remain under boxmot/reid/training/config.py. Saved hyperparameter loading and normalization live in training/hparams.py. These domain modules do not import command or engine configuration adapters.

Dataset acquisition belongs in engine/materialization/resources.py beside catalog and build orchestration. Capture timestamps belong in engine/tracking/timestamps.py; tracking/timing.py measures execution time. Console logging belongs in engine/ui/logging.py.

Dataset formats share boxmot/datasets/config.py and the id, format, storage, classes, and splits schema. A sequence layout declares per-modality encodings, paths, and parser options; split overrides select different inputs without a separate sensor config hierarchy. boxmot/datasets/inputs.py resolves those declarations. Add new file encoding parsers under boxmot/datasets/readers and return canonical observations for consumers. Tracker requirements and evaluation restrictions belong to their consumers, so a new dataset or detector export does not need tracker-specific dataset loading. See the dataset schema.

Shared tracker motion code lives under boxmot/trackers/common/motion/: models.py provides motion adapters, tracker.py integrates them with trackers, and kalman_filters/ contains filters, noise configuration, and numerical fitting. Camera-motion estimators live in cmc/, with construction in cmc/registry.py and track updates in cmc/integration.py. Keep these package initializers lightweight and import implementations from their owning modules. Dataset loading and Kalman calibration workflows belong in boxmot/engine/calibration/: kalman.py fits covariance scales from cached detections and ground truth, while ground_truth_noise.py owns annotation-based noise estimation.

Hyperparameter search belongs in boxmot/engine/tuning/. Its tuner.py owns perception-build search and sensor-dataset Optuna trials, using shared search backends. Tuning may run calibration before a search and freeze its results through calibration_profile.py. Calibration must not import tuning or require search backends.

Dependency validation lives in boxmot/utils/dependencies.py and reads package metadata. Keep package installation in boxmot/engine/commands/install.py, which owns the explicit boxmot install command. Reusable components and normal workflows should validate their requirements and report missing dependencies.

Where to start