Skip to main content
Hand tracking demo

MAVIS — Motion Analysis and Visual Interaction Suite

Track hands from a webcam, video, or frames supplied by your own application. MAVIS provides a camera-free Python API, a desktop demo, recording and replay, CSV exports, and optional calibrated multi-camera and UDP/LSL workflows.

Available on PyPI: the distribution name is mavis-track, the Python import is mavis_track, and the command is mavis-track. The current source version is 0.2.0; the first PyPI release, 0.1.0, was published on October 4, 2026. Package-index publication is separate from updating the source version. Existing handtrack imports and the handtracker command remain available for compatibility.

Try the desktop demo

Use Python 3.10–3.12, 64-bit. The intended desktop platforms are Windows x64, Linux x64, and macOS Intel/Apple Silicon. The software validation matrix passes on all four with Python 3.10–3.12; camera permissions and visible desktop behavior need device checks. See the audit for the evidence.

Create a virtual environment, then install the desktop extra:

python -m venv .venv

Activate with .venv\Scripts\activate on Windows, or source .venv/bin/activate on macOS/Linux, then:

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

The demo starts with one camera and needs no calibration. Select hands, face, pose, or everything in the window. Use --source 1 for another camera or --source path/to/video.mp4 for a video. For source development, clone this repository and install .[gui] instead.

Experimental WiLoR hands

Source checkouts include optional WiLoR inference with projected mesh/joint preview and a WiLoRTracker Python frame API. Use the WiLoR setup guide to create its separate .venv-wilor environment, obtain MANO and download checksum-verified checkpoints.

./.venv-wilor/Scripts/python.exe -m mavis_track demo --model wilor

For the RTX PC, after placing your licensed MANO_RIGHT.pkl in external/WiLoR/mano_data/, one command prepares the source, checkpoints and isolated environment while preserving existing assets:

py -3.11 scripts/setup_wilor.py --setup --require-cuda

The live Studio model selector can switch between MediaPipe and WiLoR. Real CPU inference and a live hand overlay have been checked; RTX 3060 inference, fast mode and accuracy benchmarks remain pending. This first integration supports single-source and OptiTrack multi-camera preview plus frame APIs. Multi-camera WiLoR uses one shared model and preserves the exposure/IR controls. Calibrated multi-view joints can place its mesh and skeleton together in the shared 3D view when a matching calibration is available. Mesh shape remains model-derived; the added geometry path has synthetic/software verification and still needs physical rig evaluation. Recording and streaming use the existing estimator paths.

For all connected OptiTrack cameras:

./.venv-wilor/Scripts/python.exe -m mavis_track gui --backend optitrack --model wilor --wilor-device cuda --wilor-fast

Click Start Cameras, then Show 3D View for the calibrated WiLoR mesh and skeleton. See the multi-camera guide for live-feed versus matched-overlay display and validation limits.

The OptiTrack GUI also supports named, timestamped raw-video trials with optional inference and Nexus network capture requests. Sync setup stays in a separate dialog; detailed diagnostics are saved with each trial. See the Vicon synchronization workflow for hardware wiring, alignment reports and separate synchronized replay.

Control MAVIS from another app

MAVIS 0.3.0 supports local recording control for webcams and OptiTrack. Start headless capture in one terminal, then send commands from another terminal or a trial controller on the same computer.

mavis-track capture --backend webcam --output-root .\trials
mavis-track control status
mavis-track control start --trial-name Reach_01
mavis-track control stop --trial-name Reach_01
mavis-track control status

Wait for "MAVIS capture on 127.0.0.1:5015" before sending a request. The final status reports the video directory and whether finalization has finished. The same client works with either dashboard after enabling Local UDP recording control. For shared folders, the Python client, and OptiHub settings, see External trial control.

Include MAVIS in your project

The base package does not require Qt, pandas, or LSL. Add mavis-track to your project's dependencies, or install it with python -m pip install mavis-track. Pass frames from your existing capture loop:

from mavis_track import HandTracker

with HandTracker(max_hands=2) as tracker:
    result = tracker.process(frame_bgr)  # Your uint8 image, shape (height, width, 3)
    for hand in result.hands:
        print(hand.track_id, hand.handedness, hand.landmarks.shape)
        # (21, 3) read-only coordinates owned by this result

MAVIS does not open a camera or window in this API. Empty frames produce an empty result.hands tuple. Supply timestamp=seconds for a source clock or use the default monotonic host clock. RGB input uses color="rgb". See the integration guide and the complete webcam example.

Record, replay, and export

mavis-track record --source 0 --frames 300 --max-hands 2 --session-name demo
mavis-track record --mode hand-body --source 0 --frames 300 --session-name reach
mavis-track replay recordings/demo
mavis-track export recordings/demo

Recordings contain a numeric landmarks.npz and session.json; optional --save-video adds annotated video. Export writes rectangular landmark, angle, and hand identity CSVs. Missing hands use a validity mask and NaNs. Replay honors recorded timestamps, including variable camera timing.

For synchronized single-person hand/body processing, import HandBodyTracker from mavis_track. It returns body landmarks and both hands from the same frame, with per-region missing-data, visibility, bounds, and timing flags. Combined recordings retain body visibility and quality metadata; replay/export support both regions. See the combined API guide for usage and coordinate definitions.

Coordinates and measurement limits

  • landmarks: image-normalized x/y; z is the model's wrist-relative depth, scaled similarly to x. These coordinates are not calibrated world meters.
  • world_landmarks: optional hand-centered MediaPipe model estimates in meters. Separate hands do not share a global origin.
  • angles: 14 named geometric finger flexion estimates in degrees. The angle_space field identifies the coordinates used. These are not validated clinical joint measurements.
  • track_id: short-lived association across adjacent frames. Missing hands reset association; IDs do not identify a person.

Advanced workflows

Install ".[gui,stream]" for desktop streaming. UDP can also be used with the base package. Calibrated multi-camera tracking currently assumes one hand shared across views; unrestricted multi-person/two-hand matching requires further work.

mavis-track board --backend webcam
mavis-track calibrate --backend webcam
mavis-track gui --backend webcam --advanced-hands

Calibration uses matching image dimensions, held-out quality checks, and validated camera matrices. Files live in a user data directory, with existing HANDTRACK_WEBCAM_CALIBRATION_DIR and HANDTRACK_OPTITRACK_CALIBRATION_DIR overrides supported. Source indices can change when cameras are replugged: verify physical order or recalibrate.

OptiTrack calibration (mavis-track calibrate --backend optitrack) has two stages:

  1. Individual camera intrinsics. Start with camera 0 and show the board close enough to resolve its corners clearly. Vary its position across the image, depth, and tilt; hold it still during each three-second countdown. Only the current camera needs to see the board. The target is 36 captures per camera by default. The preview pauses before each next camera; press Space when ready. Keep the cameras and lens settings fixed throughout.
  2. Camera alignment. After intrinsic quality checks pass, press Space to start alignment. Show the board to any two cameras with at least six shared corners. The preview chooses a pair and shows its progress; each pair has the same capture target. Build a connected set, such as 0–1, 1–2, and 2–3. All cameras do not need to see the board together. Lens parameters remain fixed while alignment is solved.

Space pauses/resumes capture and resets the countdown. Q advances to the next camera after at least 20 intrinsic captures, or finishes alignment once pairs with at least 20 captures connect every camera. Esc cancels and preserves the published calibration. Alignment finishes automatically when pairs meeting the full target connect every camera. Quality checks still apply before publication.

Detected corners, IDs, camera identity, board geometry, and fitted intrinsics are checkpointed beside the calibration file as calibration_observations_<timestamp>.npz. These numeric archives preserve captured data for offline investigation, including cancelled or failed runs; they are not published tracking calibrations. Automatic resume is not provided.

Recompute the newest complete saved session and publish it to the configured active calibration, without opening cameras:

python -m mavis_track replay-calibration --backend optitrack --latest

The command prints the active calibration path and whether it exists, searches that directory for observation archives, and skips incomplete/corrupt sessions. It reports missing files clearly and preserves the previous calibration if replay fails. Original corner archives cannot be used as output files. All quality gates and backup/atomic publication still apply.

To choose a particular archive and a separate output instead:

python -m mavis_track replay-calibration path/to/calibration_observations_TIMESTAMP.npz --output outputs/recovered_calibration.npz

Replay requires captured corners/IDs. An existing fitted calibration or .candidate.npz alone cannot recreate the original observations. Normal tracking loads an existing valid calibration automatically; it does not re-fit it on each launch. Replay is an explicit recovery/recompute action.

Replay applies the same intrinsic, stereo, and board reconstruction quality checks. Stereo error fits a shared board pose to both images while holding lens parameters and the camera-to-camera transform fixed. The output is saved only after all checks pass. Explicit archive selection requires an explicit output.

Validate the active calibration using a rigid ChArUco target with the configured board layout. Measure the physical distance between two printed ChArUco corner intersections, identified by their IDs in the preview. Enter your measurement in millimeters; it is not inferred from the configured square size. For example, if you measured 200 mm between corners 0 and 19:

mavis-track validate-calibration --backend optitrack --distance-mm 200 --corner-ids 0 19

The preview highlights those two corners. Place the target on a stationary support at the requested workspace location and press Space. A three-second countdown precedes 60 samples at up to 10 Hz. At least two cameras must see both corners; other cameras need not see the board. Move to the next requested location after each trial. The default locations are center, left, right, near, far, high, and low. A second visit to each location measures return displacement; use a physical fixture to reproduce the same position and orientation. With one location, remove and replace the target between visits. Space pauses and discards the current incomplete trial; Q saves and stops, and Esc cancels while retaining completed trials and available partial samples.

Use --locations center left right, --trials 2, and --samples 60 to customize the sequence. --dictionary DICT_5X5_50 skips dictionary auto-detection, and --calibration path/to/file.npz selects a different calibration. Both OptiTrack and webcam backends are supported. There is no calibration fitting or smoothing during validation: selected corners are triangulated freely, without imposing their known distance or a board pose.

Timestamped folders under outputs/calibration_validation/ contain report.json and samples.csv. Reports include signed distance bias, distance RMSE and maximum absolute error, distance standard deviation, 3D endpoint RMS jitter, and return-to-position displacement by location. Jitter includes any target motion; return displacement also includes repositioning error. CSV coordinates are in millimeters in the calibration's camera-0 frame. Reused/stale camera frames, near-parallel rays, negative depth, and excessive reprojection error are rejected; the rejection counters are detection-attempt counts, not independent samples. Host timestamps do not guarantee synchronized camera exposures. No vendor accuracy grade or pass/fail tolerance is assigned.

Using the original calibration board is a consistency check. For independent validation, use a separate rigid target with the same detectable layout and an independently measured endpoint distance; add --independent-target to record that declaration in the report. This flag does not itself verify the target.

OptiTrack remains an optional Windows SDK integration. On 2 November 2026, the operator reported that completing the USB driver installation resolved zero-camera discovery on a new PC. Complete the official Camera SDK installer's USB driver step on each new PC. The operator confirmed that the remaining SDK installation could then be cancelled after driver completion. Python installation/runtime recovery does not install USB drivers. See the tracked external setup guide for the driver-only workflow and verified local runtime recovery for Python 3.11 x64; source installations discover that runtime automatically. Use OPTITRACK_CAM_PY_PATH for another compatible binding.

For illumination, SDK frame timing and OptiHub synchronization controls, close MAVIS and run python external/setup_optitrack.py --upgrade-binding in the Python 3.11 x64 environment. This installs the checksum-verified binding-only release without a compiler. Doctor reports frame-timing and sync-control API readiness; actual electrical synchronization still needs a rig check. Use Recording / sync setup… to apply external/internal 50 Hz presets and exposure timing output. Start tracking afterward and choose Max available for one/all cameras; calibration also supports I/K intensity, M maximum and H high power.

Development and release

python -m pip install -e ".[dev,gui,io,stream,docs,release]"
python -m pytest -q
mkdocs build --strict
python -m build
python -m twine check dist/*

Publishing is gated by the full software matrix and package checks. Audit · Release checklist · Documentation · Issues

MAVIS source is MIT licensed. Optional Qt dependencies and proprietary SDKs retain their own licenses; see third-party notices.

Repository layout

Path Purpose
src/mavis_track/ Public frame API, numeric sessions and incremental recording
src/handtrack/ CLI, processing, GUI and compatibility interfaces
src/unity_hand_tracking/ Active advanced webcam/OptiTrack implementations and Unity compatibility
tests/ Hardware-independent regression tests
examples/ Runnable examples and retained research workflows
research/camera-placement/ Preserved historical Flex placement evaluations
outputs/, recordings/ Ignored new experiment outputs
build/, site/, tool caches Ignored packaging outputs; cleared after use

Recording, replay and export support bounded chunks for long sessions; see the streaming guide. The live studio keeps capture/inference off the GUI thread and displays the latest preview without a backlog. Historical placement reports are indexed in research.

Research datasets, model weights, local legacy scripts and validation snapshots are stored outside the checkout in ~/Documents/Hand-Landmark-Tracker-Research/. The examples accept --data-dir and --video; MAVIS_DATA_DIR can select another shared data root. See external research data.

Metadata

Release files for mavis-track 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mavis-track 0.3.0
File Size Uploaded Provenance Actions
mavis_track-0.3.0.tar.gz 361.1 kB Without provenance Details for mavis_track-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mavis-track 0.3.0
File Interpreter ABI Platform Actions
mavis_track-0.3.0-py3-none-any.whl Python 3 none any Details for mavis_track-0.3.0-py3-none-any.whl

Total release size: 755.3 kB

Release files / mavis_track-0.3.0.tar.gz

Download URL mavis_track-0.3.0.tar.gz
Size 361.1 kB
Tags Source
SHA-256 checksum
How to use checksums
55c18c907413c95fecd51fc729bcaec1a6bcff6bd1c5ee46b9df405286a8b84b
BLAKE2b-256 checksum
How to use checksums
a1cfabf58315d293940bc42f60ff2dd6f315e4abe41d8616dd37a7977e91cf89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / mavis_track-0.3.0-py3-none-any.whl

Download URL mavis_track-0.3.0-py3-none-any.whl
Size 394.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a4c437c76285590dedd444e58765cc9191fa150e44407b32ad952b228efe330
BLAKE2b-256 checksum
How to use checksums
a90b345e09044ee3ce6e61817897c9f714ce0bf2aef495d1babadf768fa44312
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Security for mavis-track 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page