gesture-recognizer-widget
A Jupyter anywidget that runs the MediaPipe Gesture Recognizer on your webcam and streams the results straight into Python. Each of the 21 hand landmarks is a live traitlet, so you can read finger positions, the recognized gesture, and handedness directly in a notebook — and drive anything you like with them (plots, robots, a Blender rig, …).
All inference happens in the browser via @mediapipe/tasks-vision; Python just
receives the numbers.
Install
pip install gesture-recognizer-widget
Use it in a notebook
from gesture_widget import GestureRecognizerWidget
w = GestureRecognizerWidget()
w # display the cell, then click "Start Camera"
# Individual landmarks as [x, y, z], normalized 0..1 (empty list when no hand):
w.index_finger_tip # -> [0.51, 0.42, 0.0]
w.thumb_tip
w.wrist
# High-level result for the primary (most confident) hand:
w.gesture # -> "Victory"
w.confidence # -> 0.93
w.handedness # -> "Right"
w.num_hands # -> 1
# Everything at once:
w.finger_positions() # {"wrist": [...], "thumb_cmc": [...], ...} (21 entries)
w.hands # full per-hand data for every detected hand
# React to changes:
w.observe(lambda ch: print(ch["new"]), "index_finger_tip")
# Control from Python:
w.start(); w.stop() # toggle the camera
w.mirror = False
w.max_num_hands = 1
w.sync_interval_ms = 50 # how often landmarks are pushed to Python (default 100ms)
Camera access requires a browser context: start it from the rendered widget's button (a user gesture) or via
w.start(). The model and WASM runtime are fetched from the MediaPipe CDN on first load, so the first run needs internet.
Using the development version
If you've cloned the repo and want to run against your local checkout (e.g. to hack on the widget while using the notebook), install it in editable mode after building the front-end bundle:
npm install
npm run build:widget # bundles src/widget.ts -> src_widget/gesture_widget/static/widget.js
pip install -e . # editable install of the local package
pip install -e . makes from gesture_widget import GestureRecognizerWidget
resolve to your working tree, so Python changes are picked up immediately and
rebuilding the bundle refreshes the front-end. If you're working inside an
embedded interpreter (such as Blender's bundled Python), point its pip at the
repo instead:
import subprocess, sys
subprocess.check_call([sys.executable, "-m", "pip", "install", "-e", "/path/to/caputre_motion"])
License
MIT
Metadata
Release files for gesture-recognizer-widget 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gesture_recognizer_widget-0.1.0.tar.gz | 50.7 kB | Without provenance | Details for gesture_recognizer_widget-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gesture_recognizer_widget-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for gesture_recognizer_widget-0.1.0-py3-none-any.whl |
Total release size: 102.4 kB
Release files / gesture_recognizer_widget-0.1.0.tar.gz
| Download URL | gesture_recognizer_widget-0.1.0.tar.gz |
|---|---|
| Size | 50.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea73e79ac8bd1a562101e76128f5d63949298b953c8fa9cdd19d3b35d8189989
|
|
BLAKE2b-256 checksum How to use checksums |
b5f785bfdefa8a67bc938c982e45a777f3bcdebd8da79c05b47359ecbc7d70c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / gesture_recognizer_widget-0.1.0-py3-none-any.whl
| Download URL | gesture_recognizer_widget-0.1.0-py3-none-any.whl |
|---|---|
| Size | 51.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
970bb76e240a2fd47d271584af0372a3b50c5c36c0c0ea1497e633cc1d1a2360
|
|
BLAKE2b-256 checksum How to use checksums |
0b320d803931f9ebc2ec2cf2eb09119011958df0c048e97dc7bca7f3b3718141
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Security for gesture-recognizer-widget 0.1.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.