Skip to content

deps(tracking): pin boxmot to 19.0.0 and split torch/numpy by platform - #154

Open
philsphicas wants to merge 1 commit into
AutoPTZ:mainfrom
philsphicas:deps/torch-numpy-platform-split
Open

deps(tracking): pin boxmot to 19.0.0 and split torch/numpy by platform#154
philsphicas wants to merge 1 commit into
AutoPTZ:mainfrom
philsphicas:deps/torch-numpy-platform-split

Conversation

@philsphicas

Copy link
Copy Markdown

What & why

Makes the optional tracking extra install cleanly on every supported platform
by (1) pinning boxmot and (2) resolving torch/numpy per platform.

The default install is torch-free (detection runs on ONNX Runtime; tracking
falls back to the built-in IoU tracker). The tracking extra pulls in PyTorch
transitively via boxmot, and that graph currently resolves differently — and
sometimes not at all — across platforms.

How

boxmot pinned to 19.0.0 — newest release that both keeps the tracker API
engine/pipeline/track.py uses (from boxmot.trackers import BotSort, ByteTrack, DeepOcSort with the reid_model / with_reid constructor) and
installs on every target platform:

  • 22.x moves those classes out of boxmot.trackers into per-tracker submodules
    (e.g. boxmot.trackers.botsort), breaking that import path.
  • 20.x/21.x keep the API but require numpy>=2.2, which has no compatible torch
    wheel on x86_64 macOS (last Intel torch is 2.2.2, needs numpy<2).

torch/numpy split by platform:

  • x86_64 macOS: last Intel torch wheel is 2.2.2 (needs numpy<2) →
    numpy==1.26.4, torch==2.2.2, torchvision==0.17.2.
  • All other platforms: numpy==2.2.6, torch>=2.3.1,<3,
    torchvision>=0.18.1,<1. The >=2.3.1 floor matters: torch wheels declare no
    numpy upper bound, so without it pip can pair an older torch with numpy 2 — an
    ABI mismatch that crashes at runtime.

The numpy split lives in base.txt (the torch-free core works with either
version) and is mirrored in tracking.txt so the extra installs standalone via
pip install -r requirements/tracking.txt.

Checklist

  • ruff check autoptz/ tests/ tools/ passes
  • ruff format --check autoptz/ tests/ tools/ passes
  • mypy autoptz/engine/runtime/ autoptz/config/ passes (CI gate: Linux / numpy 2.2.6)
  • pytest tests/ --timeout=60 green
  • python -m autoptz --selftest passes
  • Docs updated if behavior/config changed (rationale captured inline in the base.txt / tracking.txt comments)

Testing

Requirements-only change (no .py touched). Verified end-to-end on x86_64
macOS, Python 3.12
— the platform this split most affects — via
python tools/install.py --ci --dev --editable: the tracking stack resolves and
installs cleanly (torch 2.2.2 / torchvision 0.17.2 / numpy 1.26.4 /
boxmot 19.0.0), and ruff / ruff-format / selftest all pass. arm64-macOS /
Linux / Windows are covered by CI.

Make the optional tracking extra install cleanly on every supported
platform by pinning boxmot and resolving torch/numpy per platform.

boxmot is pinned to 19.0.0 — the newest release that both keeps the
tracker API engine/pipeline/track.py uses (`from boxmot.trackers import
BotSort, ByteTrack, DeepOcSort` with the reid_model / with_reid
constructor) and installs on every target platform. 22.x moved those
classes into per-tracker submodules (boxmot.trackers.botsort, ...),
breaking that import path; 20.x/21.x keep the API but require numpy>=2.2,
which has no compatible torch wheel on x86_64 macOS (last Intel torch is
2.2.2, needs numpy<2).

torch/numpy are split by platform:
- x86_64 macOS: numpy==1.26.4, torch==2.2.2, torchvision==0.17.2 (the
  last Intel-mac torch wheel needs numpy<2).
- every other platform: numpy==2.2.6, torch>=2.3.1,<3,
  torchvision>=0.18.1,<1. The >=2.3.1 floor matters because torch wheels
  declare no numpy upper bound, so without it pip can pair an older torch
  with numpy 2 — an ABI mismatch that crashes at runtime.

The numpy split lives in base.txt (the torch-free core works with either
version) and is mirrored in tracking.txt so the extra installs standalone
via `pip install -r requirements/tracking.txt`.

Co-authored-by: Copilot <[email protected]>
@philsphicas
philsphicas force-pushed the deps/torch-numpy-platform-split branch from a25dd9a to de79c4c Compare July 22, 2026 16:17
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.

1 participant