Skip to content

Installation

The current MAVIS source version is 0.2.0. Published packages are available on PyPI. Updating the source version does not publish a new package; install from the checkout below to use the current source. Python 3.10–3.12, 64-bit, is required; Python 3.13 and newer are excluded because the pinned MediaPipe release does not provide those wheels.

python -m venv .venv

Activate on Windows with .venv\Scripts\activate; macOS/Linux use source .venv/bin/activate.

python -m pip install "mavis-track[gui]"
mavis-track doctor --backend webcam
mavis-track demo

For source development, clone the repository and use python -m pip install ".[gui]" from its root instead.

Choose dependencies

Install extra Use
mavis-track Frame API, recording, replay, CSV export, UDP
mavis-track[gui] Qt desktop demos and advanced visualization
mavis-track[stream] / mavis-track[lsl] LSL
mavis-track[io] pandas/YAML research utilities
mavis-track[applications] Matplotlib and serial application utilities
mavis-track[ml] Research machine learning tools, including PyTorch
mavis-track[optitrack] Python helpers; proprietary SDK obtained separately
.[dev,gui,io,stream,docs,release] Tests, docs, desktop checks, release tooling

Use only one OpenCV distribution. MAVIS selects opencv-contrib-python, which MediaPipe also depends on; do not add opencv-python or headless variants into the same environment. A base install still includes MediaPipe's transitive dependencies and OpenCV's native runtime.

Platform status

The automated release matrix covers Windows x64, Linux x64, macOS Intel, and macOS Apple Silicon for Python 3.10–3.12. Configuring this matrix is not evidence that it has completed. Current local runtime evidence is recorded in the audit. Camera permissions, codecs, repeated device start/stop, and native display checks must also be tested on each supported desktop.

Grant camera permission to the terminal/Python application on macOS. On Linux, OpenCV may need desktop system libraries such as libGL; camera access requires the correct device permissions. The base package is camera-free when embedded, but it uses the standard OpenCV wheel rather than a headless variant.

OptiTrack uses an optional compiled Windows binding. Download the SDK separately, install/build a binding for your interpreter, and set OPTITRACK_CAM_PY_PATH to that folder. Its hardware compatibility is separate from webcam portability.

Verify a distribution

python -m build
python -m twine check dist/*

Install the resulting wheel in a fresh environment and run scripts/consumer_smoke.py from outside the repository. Development tests also exercise the source tree, so passing those alone does not establish wheel completeness.

Keep project environments separate

Use this repository's .venv for MAVIS. Activate Mini-Arm's own .venv from its repository when working on Mini-Arm. MAVIS uses PyQt5/Qt5; Mini-Arm's desktop runtime uses PySide6/Qt6. Keeping these installations separate avoids pulling both Qt runtimes and unrelated documentation tools into the tracker environment.

For a focused source installation, use python -m pip install -e ".[gui,stream]" in the MAVIS environment. Add the other extras only for the workflows you use. Sphinx is not needed for MAVIS tracking; its documentation build uses the docs extra (MkDocs). MediaPipe still declares JAX/JAXlib, Matplotlib and sounddevice as dependencies, so those remain installed even for camera tracking.

Research datasets and trained weights are stored outside the checkout. See the external-data guide for --data-dir, --video and MAVIS_DATA_DIR configuration.

OptiTrack on a new Windows computer

First complete the OptiTrack USB driver installation on the new PC. Launch OptiTrack's official Camera SDK installer, select the USB driver component and let that driver installation finish. Python package installation and the local runtime recovery command do not install Windows USB drivers.

For a driver-only setup, the operator verified that completing the USB driver installer and then cancelling the remaining Camera SDK installation fixed zero-camera detection on the new PC. Do not cancel the driver stage itself. Use a driver-only/custom component option when offered; installer layouts vary. The full SDK development tools are optional for the restored-runtime workflow.

Use Python 3.11 x64 and install the current checkout rather than relying on the older published package. Camera SDK 1.10.3 was used successfully with the historical Flex 13 FS setup; the new PC's installer version was not recorded. The SDK installer does not supply this project's Python binding. From a full Git clone with that environment active:

python -m pip install -e ".[gui,optitrack]"
python external/setup_optitrack.py --from-history
python -m mavis_track doctor --backend optitrack --gui
python -m mavis_track gui --backend optitrack

The tracked external/ setup files recover the two matching runtime files from existing Git history into a local, ignored folder. Checksums and the interpreter ABI are checked before use; a different existing runtime is preserved. Editable installations automatically discover that folder. USB drivers and vendor license review still use the official installer. Source ZIPs and shallow clones need a full clone or a copied matching runtime. See the external setup guide for recovery, copy and environment-variable commands.

A successful optitrack:sdk : ok verifies that the binding loads, not that USB drivers are installed or the cameras are detected. After setup, start the GUI and verify the expected camera count. An unset SDK environment variable is normal when the checkout runtime is found automatically.

Install the prebuilt camera binding

Close MAVIS and any Python process using the OptiTrack binding. With the Python 3.11 x64 tracking environment active, update the checkout and run:

git pull --ff-only
python external/setup_optitrack.py --upgrade-binding
python -m mavis_track doctor --backend optitrack --gui
python -m mavis_track gui --backend optitrack

The installer downloads the small sync-capable binding release, verifies its pinned ZIP and extension checksums, checks native imports in a separate process, then installs it beside the existing SDK DLL. It preserves the original binding as a backup and rolls back if switching the files fails. Camera initialization, USB drivers and illumination settings are not changed.

The release contains the extension, manifest and license notices only. No SDK DLLs, headers or import libraries are included. The existing matched SDK DLL and separately installed USB drivers are still required; first-time setup follows the new-computer steps above. No C++ compiler is needed for this release.

HTTPS certificate verification remains enabled. If Python cannot validate the certificate on Windows, the installer tries the Windows certificate store through the system curl client. The same pinned ZIP checksum is required.

For an offline copy of the same release ZIP:

python external/setup_optitrack.py --binding-zip "D:/downloads/optitrack-binding-cp311-win_amd64.zip"

This release retains illumination API v2 and adds frame metadata API v1 plus OptiHub sync-control API v1: SDK frame IDs/timestamps, camera metadata, sync configuration readback, external/internal 50 Hz presets and exposure timing output. The older illumination-only release remains available at its original tag.

After restart, doctor should report optitrack:illumination, optitrack:frame-timing and optitrack:sync-control as binding ready. This verifies available entrypoints; it does not measure electrical lock or exposure alignment. Apply the desired preset in Recording / sync setup… after starting cameras. See recording and synchronization.

optitrack:illumination reports that the binding is ready. Start capture to query the camera/hub capabilities, then use Max available or the individual controls. The installer does not turn the LEDs up automatically.

Build the illumination-capable binding

The default history-restored binding supports preview/exposure but lacks the illumination methods. The source branch provides a build/install helper for 64-bit CPython 3.11, the pinned historical SDK and Visual Studio 2022 C++ build tools. Build tools belong on a build PC; they are not normal MAVIS dependencies.

From the checkout, use an isolated environment so the tracking environment remains unchanged:

py -3.11 -m venv .cache/binding-env
.cache/binding-env/Scripts/python.exe -m pip install pybind11==2.13.6 cmake==3.30.5
.cache/binding-env/Scripts/python.exe external/setup_optitrack.py --from-history
.cache/binding-env/Scripts/python.exe external/build_optitrack.py --restore-sdk --install

Close MAVIS and other processes that load its Python binding before installation. The helper verifies the historical SDK headers and import library, builds only the Python extension, and checks all illumination entrypoints in a separate process without initializing cameras. It then installs the extension beside the matching local DLL. The original binding is retained as a .legacy-backup. A local binding-build.json identifies the new extension's checksum; the vendor DLL remains pinned to its historical checksum. Repeating history recovery keeps a checksum-identified local v2 build instead of downgrading it.

Restart MAVIS, then run:

python -m mavis_track doctor --backend optitrack --gui

optitrack:illumination should report that the binding is ready. Camera/hub availability is queried when capture starts. Native import verification does not establish real hardware lighting performance.

The build workflow normally verifies compilation/imports and local packaging. Its optional manual export uploads only the binding ZIP. The build helper's --bundle flag creates that ZIP locally; it excludes all SDK DLLs, headers and import libraries. The helper itself never uploads it.