Skip to main content

Motion Input Grid (MIG) Python package

English | Français

Python 3.10+ access to MIG's C++ recognition engine through standard-library ctypes. No Python inference dependency is required.

Install with python -m pip install motion-input-grid after the package is published, or python -m pip install ./bindings/python from a checkout.

Release wheels include the positions-only C ABI library and its licenses. Windows uses mig-c.dll; Linux x64/ARM64 uses libmig-c.so.1. No models or camera inference are included. Pass None to use the bundled library, or an explicit path to select an external camera-enabled SDK. A source archive includes the canonical C++ engine and JSON headers; rebuilding it requires CMake 3.25+ and a C++20 compiler. Linux source 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)

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.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 motion-input-grid 1.0.0
File Size Uploaded
motion_input_grid-1.0.0.tar.gz 280.5 kB Details

Built distributions (wheels)

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

Total release size: 1.8 MB

Release files / motion_input_grid-1.0.0.tar.gz

Download URL motion_input_grid-1.0.0.tar.gz
Size 280.5 kB
Tags Source
SHA-256 checksum
How to use checksums
257887d20cfe4bcf593ccc4250f24afb28f4e1efaabfddf63135779c5477324e
BLAKE2b-256 checksum
How to use checksums
5fdc4ac1cf653d32178fb0e0ac88e8e73cbfa7b04c88006669816ec22551cac5
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.0-py3-none-win_amd64.whl

Download URL motion_input_grid-1.0.0-py3-none-win_amd64.whl
Size 220.2 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
9005479200ee337b327bb0cf68b2cbc18136fbffcad6355d6101d82824b531d4
BLAKE2b-256 checksum
How to use checksums
85a2620fc0a78ce44daf5dbcc51fdfb5a8df4236524ccebae637ab7867fa3be1
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.0-py3-none-manylinux_2_35_x86_64.whl

Download URL motion_input_grid-1.0.0-py3-none-manylinux_2_35_x86_64.whl
Size 679.2 kB
Tags Linux glibc 2.35+ x86-64 Python 3
SHA-256 checksum
How to use checksums
a503be731db11d8ab7c1bf0190dffbee8b4540c2275e86afc556545c93b10ebc
BLAKE2b-256 checksum
How to use checksums
43665cdbabf925c38172ff6c6b2dba0df1c3b4c1487801aef75146c144421643
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.0-py3-none-manylinux_2_35_aarch64.whl

Download URL motion_input_grid-1.0.0-py3-none-manylinux_2_35_aarch64.whl
Size 669.0 kB
Tags Linux glibc 2.35+ ARM64 Python 3
SHA-256 checksum
How to use checksums
a9a11335625e05bcb1ec455fcfaf24e096c1aeaefe176251ae3c3cb5f38bfaf3
BLAKE2b-256 checksum
How to use checksums
217be01eba2970ae84ce15653958886907b34b8983f0cc5e3fe14a58d5040cfe
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

1.0.1

4 release files

This release

1.0.0 This release

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