Skip to main content

Motion Input Grid (MIG) Python package

English | Français

Install from PyPI

python -m pip install motion-input-grid
python -c "from mig import Tracker; print('MIG OK')"

The distribution name is motion-input-grid; the import remains mig. Prefer a Python 3.10+ virtual environment. Wheels cover Windows x64 and Linux x64/ARM64 with glibc 2.35+. On other platforms, pip may build the sdist, requiring a C++20 compiler and CMake 3.25+. To select a version: python -m pip install motion-input-grid==1.0.0.

Local alternative: python -m pip install /path/to/motion_input_grid-1.0.0-<tags>.whl. To build from a full checkout: python -m pip install ./bindings/python.

Submit observations

Save a configurator profile as profile.json. Pass None to select the bundled engine or an explicit path to an external SDK. This example submits one frame; your application should feed the tracker each new observation. One frame alone does not calibrate or complete a movement.

Python accesses the C++ engine through standard-library ctypes; no Python inference dependency is required. Wheels include the positions C ABI and licenses: mig-c.dll on Windows, libmig-c.so.1 on Linux. No camera estimator or models are included. The sdist contains the canonical engine and JSON headers; rebuilding requires CMake 3.25+ and a C++20 compiler. Linux builds use GCC and its runtime copyright notices.

from pathlib import Path
from mig import Packet, Tracker

profile = Path("profile.json").read_text(encoding="utf-8")
with Tracker(None, profile) as tracker:
    frame = Packet(timestamp_ms=20, sequence=1, aspect=16 / 9)
    frame.set_body(11, 0.65, 0.45)
    frame.set_body(12, 0.35, 0.45)
    frame.set_body(15, 0.4, 0.6)
    for action, input_id in tracker.update(frame):
        print(action, input_id)

Lifecycle and camera

Use increasing timestamps in milliseconds and increasing sequence numbers. Calibration requires roughly one second with both shoulders visible. Positions use unmirrored anatomical MediaPipe indices; missing points have zero confidence. Keep each tracker on one owning thread and close it explicitly.

start_camera(runtime_directory) and poll_camera() optionally use a native camera-enabled SDK plus its MediaPipe runtime and models. Poll already updates recognition; consume events() afterward without submitting the frame twice. Action callbacks are logical events; keyboard injection is the host's choice.

See the repository's examples and ABI contract for body and hand XYZ packets, capture ownership, Pygame and Tkinter integration.

Complete source walkthrough · Bootstrap.

Metadata

Release files for motion-input-grid 1.0.1

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

Source distribution (sdist)

Source distribution for motion-input-grid 1.0.1
File Size Uploaded
motion_input_grid-1.0.1.tar.gz 284.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for motion-input-grid 1.0.1
File Interpreter ABI Platform
motion_input_grid-1.0.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
motion_input_grid-1.0.1-py3-none-manylinux_2_35_x86_64.whl Python 3 none Linux glibc 2.35+ x86-64 Details
motion_input_grid-1.0.1-py3-none-manylinux_2_35_aarch64.whl Python 3 none Linux glibc 2.35+ ARM64 Details

Total release size: 1.9 MB

Release files / motion_input_grid-1.0.1.tar.gz

Download URL motion_input_grid-1.0.1.tar.gz
Size 284.5 kB
Tags Source
SHA-256 checksum
How to use checksums
11007ae12365bccbe28529f8a2a558e12b8179ba3ff8bf942477139abf380717
BLAKE2b-256 checksum
How to use checksums
d5f57cc5bdf15478f97292e974c37eadf2ffa261c89d0d70c472598207be818a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / motion_input_grid-1.0.1-py3-none-win_amd64.whl

Download URL motion_input_grid-1.0.1-py3-none-win_amd64.whl
Size 220.5 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
924e2e84c5682ff22ff57f2c99090e0261233ec71cae0be4638b68232ed76a85
BLAKE2b-256 checksum
How to use checksums
a6aa44ba3c77376bd232c8c345eeb06c9064e855d430c6aa6f9cebe39346e64c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / motion_input_grid-1.0.1-py3-none-manylinux_2_35_x86_64.whl

Download URL motion_input_grid-1.0.1-py3-none-manylinux_2_35_x86_64.whl
Size 679.5 kB
Tags Linux glibc 2.35+ x86-64 Python 3
SHA-256 checksum
How to use checksums
fe422d8663eb098fee36ee42910bb983b17666377451907ec7280781ece9cba9
BLAKE2b-256 checksum
How to use checksums
7707af8871d3831271e223776d3017673576247c1e8dc50b492f38c819101dd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / motion_input_grid-1.0.1-py3-none-manylinux_2_35_aarch64.whl

Download URL motion_input_grid-1.0.1-py3-none-manylinux_2_35_aarch64.whl
Size 669.3 kB
Tags Linux glibc 2.35+ ARM64 Python 3
SHA-256 checksum
How to use checksums
0d0c1123718a79ef128c43682ebc6207a803d19eb54d2440b367624766b28136
BLAKE2b-256 checksum
How to use checksums
591bf5af446a21db4d5678c639c40bbf9a567d4addb9fd93aaf20e67b8b5fb53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release history Release notifications | RSS feed

This release

1.0.1 This release

4 release files

1.0.0

4 release files

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