boxmot

mikel-brostromAGPL-3.0活跃维护

提供可插拔的 Python 和 C++ 多目标跟踪模块,集成 BoT-SORT、ByteTrack、OC-SORT 等 SOTA 算法,支持轴对齐与旋转框跟踪。

BoxMOT: Pluggable Python and C++ SOTA multi-object tracking modules with support for axis-aligned and oriented bounding boxes

v26.0.0发布于 2026-10-27 11:38 UTC8,324star1,914fork同步于 2026-11-10 23:32 UTC

怎么上手

由 README 提炼,执行前请确认
pip install boxmot
boxmot --help
硬件要求按 README 说明

README 未说明具体显存或 GPU 型号要求;默认安装使用 PyPI 标准 PyTorch 构建,源码安装可选 cpu 或 cu130 配置。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

可插拔的多目标跟踪模块库,支持任意检测器的AABB与OBB跟踪

提供可插拔的 Python 和 C++ 多目标跟踪模块,集成 BoT-SORT、ByteTrack、OC-SORT 等 SOTA 算法,支持轴对齐与旋转框跟踪。

核心能力

  • 统一 track/eval/tune/train-reid 等 CLI 子命令
  • 检测器、ReID 编码器与跟踪器可自由替换组合
  • 内置 occluboost、botsort、bytetrack 等 SOTA 跟踪器
  • 支持 AABB 与 OBB 两种跟踪路径
  • 可选原生 C++ 跟踪后端,指标与 Python 路径一致

容易踩的坑

需 Python 3.10 至 3.13;yolo、onnx、openvino、tflite 等模式需额外安装对应 extras;C++ 后端需另行安装平台依赖并用 --tracker-backend cpp 启用。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v26.0.0
  1. v26.0.0Release v26.0.0最新正式版2026-10-27 · 2026-10-27 11:38 UTC

    BoxMOT v26.0.0

    BoxMOT v26.0.0 adds multimodal tracking, optional EdgeTAM mask guidance, typed tracker configuration, and joint motion-model selection. It also improves evaluation reproducibility, replay performance, and tuning diagnostics.

    Based on committed changes since v25.0.0, through 9da023fd.

    New features and improvements

    • EagerMOT sensor fusion: Track objects using calibrated 2D and 3D detections, with optional camera poses. New spatial structures represent 3D boxes, camera calibration, and multimodal outputs. Includes KITTI evaluation, class-specific tuning, and 3D Kalman calibration.
    • MAF-HDA mask tracking: Adds a Python tracker combining motion with mask-based correlation-filter appearance. Supports AABB detections with instance masks without requiring ReID weights.
    • EdgeTAM integration: Generate detection masks with the standalone segmentor or enable temporal mask-guided association using --edgetam. Guidance supports the nine Python box trackers with AABB geometry, IoU association, and per_class=False.
    • Typed configuration and simpler factories: All eleven trackers expose immutable, validated configuration classes with editor completion. Detector, ReID, and tracker factories support simpler construction, while shared KalmanConfig and ReIDConfig group component settings.
    • Joint motion selection: tune --select-kf compares compatible Kalman filters and noise profiles using held-out predictions. Add --select-cmc to jointly select camera-motion compensation. Selected profiles are saved for reuse.
    • More targeted tuning: Conditional search spaces account for geometry, association metric, and enabled features. New controls expose motion, detection-confidence, and ReID–IoU fusion, with improved trial comparisons and parameter diagnostics.
    • Expanded evaluation: Adds KITTI-MOTS mask evaluation, saved 2D detection workflows, 3D tracking metrics, and optional official KITTI AP40 reports. Materialized AABB evaluation supports ordered GTA, GSI, and GBRC postprocessing while preserving raw results.
    • Faster repeated workloads: Batched Kalman operations, optimized camera-motion compensation, indexed embedding reads, reusable workers, and optional --cache-inputs reduce repeated processing.
    • Reliability fixes: Restores per-sequence evaluation reporting, corrects DeepOC-SORT covariance handling during camera compensation, cleans up orphaned workers, and fixes Python 3.10 typing compatibility. OpenCV is pinned to 4.11.0.86, and its runtime version participates in perception-cache identity.

    Breaking changes

    This major release includes breaking changes. When upgrading from v25:

    • Update direct tracker construction. Pass algorithm settings through the matching config, such as BotSort(config=BotSortConfig(...)). The factory also accepts algorithm keywords: create_tracker("botsort", match_thresh=0.8).
    • Group component settings. Move flat Kalman options into kalman and kalman.noise; configure tracker-owned appearance through reid=ReIDConfig(...) or an injected appearance encoder.
    • Replace track_buffer. ByteTrack and BoT-SORT now use max_lost_frames, counted directly in tracker updates without FPS scaling.
    • Review removed tracker features. SAM2MOT has been removed; standalone SAM segmentation remains available. OccluBoost's online GTA controls are removed, and its AABB/OBB thresholds and lifetime settings are consolidated.
    • Review centroid thresholds. centroid_max_distance now determines geometric eligibility across matching and recovery; overlap thresholds no longer restrict centroid matching.
    • Update commands and imports. Replace boxmot time-variant with boxmot materialize --time-variant. Internal tracker and motion modules have moved; prefer public imports from boxmot.
    • Rebuild native libraries. ByteTrack, BoT-SORT, and OccluBoost use constructor ABI v3. Their shared update/res
  2. v25.0.0Release v25.0.02026-09-09 · 2026-09-09 18:34 UTC
    查看更新说明

    BoxMOT v25.0.0 rebuilds the engine around modular commands, composable tracking pipelines, and resumable perception builds. It also introduces an HTTP tracking service, faster cached evaluation, timestamp-aware tracking, and Kalman calibration. This is a breaking release for Python integrations, dataset caches, and native extensions. These notes cover changes since v23.0.0, the previous published release.

    The engine rebuild establishes a new foundation for tracking, evaluation, and tuning:

    • Modular CLI: Replaced the monolithic CLI implementation with lazily loaded command modules and shared option groups.
    • Composable tracking execution: Separated frame sources, perception and tracking pipelines, execution runners, and output sinks. The runner manages sequence resets, interruption handling, resource cleanup, and timing.
    • Typed component interfaces: Introduced Frame, Boxes, OrientedBoxes, MaskBatch, Detections, Tracks, and PipelineResult, alongside immutable component specifications and factories.
    • Resumable materialization: Added separate detection, segmentation, embedding, and finalization stages. Stage fingerprints, completed-work tracking, retries, and shared detection caching allow interrupted builds to resume and compatible work to be reused.
    • Immutable perception datasets: Replaced positional caches with keyed Parquet builds joined by sample and instance IDs. Changing ReID models can reuse compatible detector results.
    • Reworked evaluation and tuning: Both workflows consume materialized builds through the live tracker API. When --build is omitted, they prepare or reuse a compatible build before replay or optimization. Individual tuning trials reuse prepared perception results.
    • Clearer package responsibilities: The engine owns command and workflow orchestration; domain packages contain reusable detector, tracker, ReID, training, evaluation, and export components. Additional capabilities improve deployment and experimentation:
    • HTTP tracker service: Added boxmot-service for session-based tracking, with CPU and GPU service images alongside full CLI Docker profiles. Requests containing images can infer frame dimensions.
    • Faster cached replay: Reduced startup and loading overhead through prefetching, streamed Parquet reads, metadata reuse, and image decoding only when required.
    • Experiment selection: Evaluation and tuning can resolve authored experiments through dataset, detector, and ReID profiles.
    • Flexible tracker inputs: Added NumPy BGR image support for Python and native adapters. Packed NumPy detections return packed NumPy tracks; structured Detections return Tracks.
    • Shared live ReID extraction: Supported trackers generate missing embeddings lazily from supplied frames. Attached embeddings bypass encoder inference.
    • Selectable association metrics: Added configurable IoU, GIoU, DIoU, CIoU, HMIoU, and centroid association with AABB and OBB geometry. OBB CIoU and HMIoU remain experimental.
    • Timestamp-aware tracking: Added experimental --variable-dt support for supported Python Kalman trackers. Prediction uses capture timestamps; fixed-step behavior remains the default. Native backends retain fixed-step prediction.
    • Kalman calibration: Added --calibrate-kf to estimate noise settings from cached detections and ground truth before evaluation or tuning. Kalman settings remain fixed during tracker optimization.
    • Reusable tracker configurations: Added --tracker-config for loading presets, parameter overrides, and saved calibration profiles.
    • Frame-rate experiments: Added dataset sampling through --fps and reproducible dropped-frame experiments through time-variant, preserving capture timestamps and reusing cached perception results.
    • Evaluation visualization: Added --show and --save for annotated sequence previews and videos.
    • Detailed diagnostics: Expanded startup and runtime reporting for acquisition, component execution, rendering, and output handling.

    When upgrading, update int

  3. v23.0.0Release v23.0.02026-08-26 · 2026-08-26 20:38 UTC
    查看更新说明

    This major release completes oriented-box support across the Python tracker set, introduces reproducible experiment catalogs, improves native/Python parity, and substantially expands ReID training and deployment.

    Highlights

    • All registered Python trackers now support canonical AABB and OBB inputs and outputs.
    • Added oriented association, angle-continuous motion updates, OBB-aware CMC and ReID crops, and row-aligned masks.
    • Replaced monolithic benchmark configs with validated datasets, detectors, ReID profiles, artifacts, presets, and composable experiments.
    • Experiment runs now preserve both authored and fully resolved configurations.
    • MOT evaluation now parallelizes sequences and adds IDt, IDa, and IDm diagnostics.
    • Added optional TrackEval comparison through --compare-trackeval and the trackeval extra.
    • Hardened native AABB/OBB replay, CMC, fixed-batch ReID, cache identity, and Python/C++ metric parity.
    • Expanded CSL-TinyViT, MobileNetV4, and Hi-AFA training, including privileged anatomical supervision, advanced augmentation, provenance checks, and reliable resume support.
    • Added compare-reid for cross-domain checkpoint evaluation.
    • Added native Core ML FP16 export and inference with configurable static batch buckets.
    • Reduced tracker startup and CMC overhead, exposed setup timings, and added saved-video FPS control.
    • Versioned embedding caches by producer, runtime, model fingerprint, preprocessing policy, and crop schema.

    Breaking Changes and Migration

    v22v23
    --benchmark / benchmark=--experiment / experiment= for reproducible workflows
    Model-free benchmark selection--dataset / dataset=
    boxmot trainboxmot train-reid
    boxmot/configs/benchmarks/configs/experiments/, datasets/, detectors/, reid/, and artifacts/
    boxmot/configs/modes.yamlboxmot/configs/runtime.yaml
    boxmot.pipelineboxmot.api.pipeline
    boxmot.reid.core.reidboxmot.reid.core.runtime
    boxmot.trackers.occluboostboxmot.trackers.bbox.occluboost
    DeepOCSORT iou_threshiou_threshold

    Recommended evaluation commands:

    boxmot eval --experiment mot17-ablation-yolox-lmbn --tracker boosttrack
    boxmot eval --dataset mot17 --split ablation --tracker boosttrack
    

    The stable public imports remain:

    from boxmot import BoxMOT, Detector, ReIDModel
    

    Additional migration notes:

    • Custom trackers must implement _track_detections() instead of _update_impl().
    • Detection and result validation is stricter; empty arrays must retain their canonical column shape.
    • TrackResults.xyxy returns the enclosing AABB in OBB mode. Use .boxes or .xywha for oriented geometry.
    • Legacy embedding caches may be regenerated when their producer, model, runtime, or crop semantics cannot be verified.
    • Finite file and directory sources are consumed before BoxMOT.track() returns. Use boxmot.api.functional.track() when lazy finite-source iteration is required.

    What’s Changed

    Full Changelog: v22.0.0...v23.0.0

    Contributors

  4. v22.0.0Release v22.0.02026-07-10 · 2026-07-10 13:32 UTC
    查看更新说明

    BoxMOT v22.0.0

    This release is a large architecture update centered on the tracker stack, the public Python API, ReID workflows, and evaluation metrics.

    Highlights

    • Added a cleaner high-level Python API with BoxMOT, Detector, and ReIDModel.
    • Standardized tracker internals around shared base classes, registries, detection layouts, association helpers, motion utilities, and common track models.
    • Replaced the bundled TrackEval runtime path with BoxMOT's integrated MOT metrics implementation.
    • Preserved MOT metric behavior as closely as possible, including HOTA, MOTA, IDF1, AssA, AssRe, ID switches, and OBB evaluation support.
    • Moved benchmark dataset roots to BoxMOT-owned locations under boxmot/datasets/mot and boxmot/datasets/reid.
    • Reorganized ReID backbones, training recipes, pretrained loading, and export paths.
    • Added dynamic-batch ONNX export by default for the high-level Python ReID workflow.
    • Improved benchmark download handling and cleaner progress output.

    New Python API

    The recommended Python entry points are now:

    from boxmot import BoxMOT, Detector, ReIDModel
    from boxmot.trackers import OccluBoost
    

    Basic evaluation:

    from boxmot import BoxMOT
    
    model = BoxMOT(
        detector="yolox_x_MOT17_ablation",
        reid="models/lmbn_n_duke.pt",
        tracker="occluboost",
    )
    
    results = model.val(
        benchmark="mot17",
        split="ablation",
    )
    
    print(results)
    

    ReID export and embedding:

    from boxmot import ReIDModel
    
    reid = ReIDModel("models/lmbn_n_duke.pt")
    reid = reid.export(format="onnx", half=True)
    
    embeddings = reid.embed(
        image,
        boxes=detections.xyxy,
    )
    

    Default vs tuned tracker evaluation:

    from boxmot import BoxMOT
    
    model_args = {
        "detector": "yolox_x_MOT17_ablation",
        "reid": "models/lmbn_n_duke.pt",
        "tracker": "occluboost",
    }
    
    eval_args = {
        "benchmark": "mot17",
        "split": "ablation",
    }
    
    model = BoxMOT(**model_args)
    default_results = model.val(**eval_args)
    
    tuned = model.tune(
        **eval_args,
        n_trials=10,
        objectives=["hota", "id_switches"],
    )
    
    tuned_model = BoxMOT(
        **model_args,
        tracker_kwargs=tuned.best_config,
    )
    tuned_results = tuned_model.val(**eval_args)
    

    Tracker Refactor

    • Added boxmot/trackers/base.py as the shared tracker base.
    • Added boxmot/trackers/registry.py and boxmot/trackers/specs.py.
    • Flattened many tracker modules so public imports are simpler and more stable.
    • Added shared packages under boxmot/trackers/common/ for:
      • appearance plumbing
      • association logic
      • detection layout handling
      • OBB geometry helpers
      • motion and CMC utilities
      • track lifecycle and output formatting
      • reusable track model implementations
    • Added extensive tracker contract tests, including bbox/OBB behavior and common association/motion utilities.

    Evaluation And Metrics

    • Removed the old boxmot.engine.eval.trackeval runtime package.
    • Added boxmot.engine.eval.motmetrics.
    • Added in-repo tests for MOT metrics adapter and runner behavior.
    • Kept AABB and OBB evaluation support.
    • Updated evaluator, replay, tuning, and reporting paths to use the integrated metrics implementation.

    Dataset Layout

    Benchmark data is now owned by BoxMOT instead of living under the removed TrackEval tree:

    boxmot/datasets/mot
    boxmot/datasets/reid
    

    This avoids keeping dataset assets under boxmot/engine/eval/trackeval/data now that TrackEval has been removed.

    ReID Updates

    • Reorganized ReID backbones into family/common modules.
    • Added a backbone registry.
    • Added shared pretrained-loading helpers.
    • Added MobileNetV4 training configs:
      • mobilenetv4
      • mobilenetv4_conv_small
      • mobilenetv4_conv_medium
      • mobilenetv4_conv_large
    • Added ReID training recipe modules.
    • Added ReID comparison/data workflow modules.
    • Expanded ReID core,
  5. v21.0.0Release v21.0.02026-06-03 · 2026-06-03 17:18 UTC
    查看更新说明

    Highlights

    • Mask visualization — tracking results now render segmentation masks when available
    • HuggingFace CLI downloads — model and dataset downloads switched to the hf CLI for faster, more reliable fetches
    • Cleaner tracking UI — streamlined Rich terminal output with more discrete, focused panels
    • Memory leak fix — BotSort's removed_stracks list could grow without bound; now capped via deque(maxlen=100)

    New Features

    AreaChange
    SegmentationShow masks overlay during tracking when using a seg model
    DownloadsUse huggingface_hub CLI (hf download) for weights and datasets
    Track UIMore discrete Rich panels — removed verbose parameter dumps
    LogoUpdated project logo (higher resolution)

    Bug Fixes

    • BotSort memory growth — removed_stracks converted to a bounded deque(maxlen=100) to prevent unbounded RAM usage on long sequences
    • Benchmark CI — fixed flaky workflow; added dedicated HF dataset download job with caching

    Internal Improvements

    • Tuner hardening — config parsing validates YAML structure and prints available trackers on FileNotFoundError; malformed param entries are warned and skipped instead of crashing
    • Rich UI consolidation — shared formatters moved to boxmot/utils/rich/__init__.py; eval/tune/track reporters simplified
    • Evaluator simplification — ~100 lines of dead code removed
    • Timing module — removed legacy accumulation branches; cleaner cached-detection display ("loaded from cache (0 ms)")
    • Dataset loader — simplified _collect_seq_info with direct fallback to seqinfo.ini
    • CI benchmark — single ubuntu-latest runner with HF cache layer instead of full os×python matrix

    Dependencies

    • uv.lock refreshed
    • pyproject.toml minor version bumps

    Upgrade Notes

    If you rely on raw timing dictionaries with keys preprocess / inference / postprocess, switch to detector_preprocess / detector_process / detector_postprocess. Dictionary access via the old names still works for reads (via _AliasedTotals) but will be removed in a future release.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    CI Coverage PyPI version downloads license python-version DOI colab discord


    Docs • Installation • Modes • API Reference • Trackers • Contributing

    BoxMOT provides independent detector, segmentor, appearance-encoder, and tracker components built around validated Torch structures. Pipelines compose those components; the CLI owns sources, outputs, materialized datasets, evaluation, tuning, research, and ReID workflows.

    Why BoxMOT

    • One interface for track, materialize, materialize --time-variant, eval, tune, research, train-reid, eval-reid, compare-reid, export, export-edgetam, install, and native build workflows.
    • Swappable components with explicit capabilities and requirements.
    • Immutable, keyed Parquet builds with reusable detections, masks, and embeddings.
    • Support for both AABB and OBB tracking paths.
    • Optional production-ready native C++ tracker implementations with the same metrics as the Python path, opted into via --tracker-backend cpp and embeddable in standalone C++ projects via CMake (see Native C++ Integration and platform dependency installation).
    • A structured Python API for embedding components and pipelines in applications.

    Installation

    BoxMOT supports Python 3.10 through 3.13.

    pip install boxmot
    boxmot --help
    

    The default package uses the standard PyPI PyTorch build. Source checkouts and CI can explicitly select the lockfile-backed cpu or cu130 profile. For those profiles and mode-specific extras such as yolo, service, evolve, research, onnx, openvino, and tflite, see the installation guide.

    Benchmark Results

    Related guides:

    Minimal Usage

    CLI:

    boxmot track --detector yolo26n --reid lmbn_n_duke --tracker occluboost \
      --source 0 --save --show
    

    Evaluate a tracker:

    boxmot eval \
      --dataset mot17 \
      --split ablation \
      --detector yolox-x-mot17 \
      --reid lmbn-n-duke \
      --tracker botsort
    

    Python with axis-aligned boxes (AABB):

    import numpy as np
    
    from boxmot import OccluBoost
    
    tracker = OccluBoost()
    dets = np.array([[100, 200, 300, 400, 0.9, 0]])
    frame = np.zeros((480, 640, 3), dtype=np.uint8)  # BGR image
    tracks = tracker.update(dets, frame)
    print(tracks[:, 4].astype(int))  # track IDs
    

    Python with oriented boxes (OBB):

    import numpy as np
    
    from boxmot import OccluBoost
    
    tracker = OccluBoost(is_obb=True)
    # cx, cy, width, height, angle in radians, confidence, class_id
    dets = np.array([[200, 300, 200, 100, np.pi / 6, 0.9, 0]])
    frame = np.zeros((480, 640, 3), dtype=np.uint8)  # BGR image
    tracks = tracker.update(dets, frame)
    print(tracks[:, 5].astype(int))  # track IDs
    

    2D/3D sensor fusion with ego-motion compensation using EagerMot:

    import numpy as np
    
    from boxmot import EagerMot
    
    tracker = EagerMot()
    camera = np.array([  # synthetic camera projection
        [100, 0, 100, 0],
        [0, 100, 50, 0],
        [0, 0, 1, 0],
    ])
    camera_to_world = np.eye(4)
    camera_to_world[0, 3] = 1.0  # synthetic pose: camera at world x = 1 meter
    dets = np.array([[78, 39, 122, 62, 0.95, 0]])
    # 3D in camera coordinates: x, y, z, yaw, length, width, height, confidence, class_id
    dets_3d = np.array([[0, 1, 10, 0, 4, 2, 2, 0.9, 0]])
    
    tracks_2d, tracks_3d = tracker.update(
        dets,
        detections_3d=dets_3d,
        camera=camera,
        image_size=(100, 200),  # height, width
        camera_to_world=camera_to_world,
    )
    print(tracks_2d[:, 4].astype(int))  # image track IDs
    print(tracks_3d[:, 7].astype(int))  # 3D track IDs
    

    Replace the synthetic pose with the current frame's absolute 4×4 camera-to-world transform on every update. KITTI evaluation loads these from poses.npy when the dataset declares a poses modality. If poses are unavailable, omit camera_to_world throughout the sequence to track in camera coordinates.

    Contributing

    Start with CONTRIBUTING.md and the contributor docs.

    Contributors

    Support and Citation