Optional onnxruntime [tracking] extra + dependency cleanup (0.9.0)#980
Merged
Conversation
- Promote numpy to a direct runtime dependency. It is imported across the codebase but was only present transitively via pandas/scipy/opencv, leaving the imports unguarded by any version constraint. - Remove four redundant transitive security floor pins (urllib3, fonttools, pillow, protobuf). Each now resolves to a CVE-safe version on its own as the upstream parents have caught up; dependabot remains the backstop if a future resolution ever regresses. - Drop unused dev dependencies openpyxl and pywinctl. Removing pywinctl prunes ~180 transitive entries (the macOS pyobjc framework tree, Windows pywin32, and X11 bindings) from the universal lockfile. - Lift the obsolete av<16.1.0 cap. Linux wheels now ship for 16.1.0+, so bump to av 17.x (resolves 17.0.1); verified against the video I/O test suite.
Neural pose tracking is the only consumer of onnxruntime, imported in a single file behind the Tracker interface. Calibration and triangulation never touch it, so a bare install no longer needs to carry onnxruntime and its protobuf/sympy tail. - Move onnxruntime out of core dependencies into a new [tracking] extra. The [gui] extra self-references caliscope[tracking] so GUI installs always include inference. - Lazy-import onnxruntime inside OnnxTracker.__init__ instead of at module top. The tracker module stays importable on a lean install (the registry can still scan/list ONNX models); only constructing a tracker without the extra raises a ModuleNotFoundError pointing at pip install caliscope[tracking]. - Gate the ONNX tracker tests with pytest.importorskip so they skip cleanly when onnxruntime is absent rather than erroring. A bare pip install caliscope is now a lean, calibration-only install.
The install contract changed: a bare install is now calibration-only and neural pose tracking requires the tracking extra. Update the user-facing install instructions to match. - README, installation, index, scripting: present three tiers (bare caliscope for calibration, [tracking] for ONNX pose tracking, [gui] for the desktop app which includes tracking). - onnx_trackers: correct the line that claimed ONNX inference needs no extra packages; it now requires caliscope[tracking] (or [gui]). - installation: add a note that the docs site tracks the development version on main and may differ from the latest PyPI release.
Signals the changed install contract: onnxruntime moves to the optional [tracking] extra, so a bare install is now calibration-only. A minor bump per 0.x convention for a notable, mildly breaking change to the default install surface.
Treat the [tracking] extra as an internal seam, not a user-facing install path. ONNX pose tracking is used through the GUI and there is no documented headless tracking workflow yet, so the docs offer two paths: the base calibration library and caliscope[gui] (which includes pose tracking). The [tracking] extra stays in pyproject so [gui] can depend on it and as scaffolding for possible future headless tracking, it is simply not advertised in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes
onnxruntimean optional dependency and tidies the dependency surface. A barepip install caliscopeis now a lean, calibration-only install (OpenCV-based charuco/aruco/chessboard calibration + triangulation). ONNX pose tracking moves behind a[tracking]extra, and[gui]pulls it in automatically.Changes
Dependency cleanup
numpyto a direct dependency (imported throughout, previously only transitive).urllib3,fonttools,pillow,protobuf). Each resolves to a CVE-safe version on its own now that upstream parents have caught up; dependabot remains the backstop.openpyxlandpywinctl(the latter pruned ~180 macOS/Windows binding packages from the universal lockfile).av<16.1.0Linux-wheel cap; bump to av 17.x.Optional tracking
onnxruntimefrom core into a new[tracking]extra;[gui]self-referencescaliscope[tracking].OnnxTracker.__init__. The module stays importable on a lean install (the registry can still scan/list models); only constructing a tracker without the extra raises aModuleNotFoundErrorpointing atpip install caliscope[tracking].pytest.importorskip.Docs + version
Breaking change
A bare
pip install caliscopeno longer includes ONNX neural pose tracking. Installcaliscope[tracking](orcaliscope[gui], which includes it). Minor bump per 0.x convention.Verification
Built three isolated environments and asserted the contract in each:
.): no onnxruntime, no PySide6; core +caliscope.apiimport; registry import-safe; tracker construction raises the friendly error..[tracking]): onnxruntime present, PySide6 absent (independent axes)..[gui]): both present (gui pulls tracking).Targeted suites pass: 60 video I/O tests against av 17, the ONNX tracker tests under
[tracking]. Full functional coverage runs in CI under gui+dev.