Skip to main content

GesturePlayKit 1.2.0 🖐️👄🕺

Make webcam games, interactive art, virtual props, motion controls, and experimental AR using simple Python functions.

GesturePlayKit wraps Google's MediaPipe Tasks: 21 hand landmarks, 478 face landmarks, 52 optional face-expression blendshapes, and 33 optional body-pose landmarks. You write your own rules, UI, achievements, art, and gameplay. Hand, mouth, eye, and body detections are approximations, not guaranteed physical contact or medical measurements.

Release: Source code for v1.2.0. A GitHub push does not automatically upload to PyPI; see publishing instructions.

Getting started

Python 3.10+ is supported when compatible MediaPipe binaries exist for your platform. Install from this repository:

python -m pip install .
python -m gestureplaykit download-models --poses

By default models go to ./models/, relative to the directory from which you start your program. All detection operates locally after the models are downloaded. The --poses flag adds the optional body model; without it you only download hand and face models.

Try examples/07_mouth_expressions.py or this minimal script:

from gestureplaykit import Camera, Vision, show_text

with Camera() as camera, Vision() as vision:
    while True:
        frame = camera.read()
        if frame is None:
            break
        vision.update(frame)
        if vision.hand and vision.hand.pinching:
            show_text(frame, "PINCH!", at=(20, 60))
        if vision.face and vision.face.mouth_open:
            show_text(frame, "MOUTH OPEN", at=(20, 100))
        if vision.face and vision.face.smiling:
            show_text(frame, "SMILING!", at=(20, 140))
        if not camera.show(frame):
            break

To use body tracking:

from gestureplaykit import Camera, Vision, draw_pose
with Camera() as camera, Vision(hands=False, faces=False, poses=True) as vision:
    while (frame := camera.read()) is not None:
        vision.update(frame)
        if vision.pose:
            draw_pose(frame, vision.pose)
            if vision.pose.arms_raised:
                print("Hands up!")
        if not camera.show(frame):
            break

Features

  • Hand gestures: pinch hold/start/end/double, fingertip contact, open palm, fist, peace sign, pointing, finger count, palm position, estimated handedness, multiple-hand IDs, and approximate world coordinates.
  • Face: mouth open/close events and position, eye positions, mouth width/height, blink events, smile, wink, brow/jaw and 52 other optional expression scores, 478 landmarks, and optional transformation matrix.
  • Body: 33 pose landmarks, shoulders/hips centers, raised arms, elbow/knee angles, point visibility, and skeleton drawing.
  • Image/overlay: local or HTTP(S) PNG/JPG, alpha blending, opacity, resizing, cropping to frame, text, points, lines and rectangles. One-command picture visibility toggle (hide_all_pictures(), show_all_pictures(), toggle_pictures()).
  • Offline once models and any remote images have been downloaded; no camera data is uploaded by this library.
  • Model downloader (python -m gestureplaykit download-models) and tested Python-first API.

Hide all pictures with one command

from gestureplaykit import show_picture, hide_all_pictures, show_all_pictures

hide_all_pictures()  # Every future show_picture() call draws nothing.
show_all_pictures()  # Display picture overlays again.

toggle_pictures() flips the current setting; pictures_visible() returns True or False. This switch affects picture overlays drawn with show_picture() only. It does not blank the webcam, remove text or landmarks, or erase images already drawn on an existing frame. In a normal camera loop, the next fresh frame will be clear. See example 10.

Complete documentation

Important limitations

Camera and model accuracy depend on lighting, occlusion, frame rate, and angles. hand.id is best-effort and may change when hands leave or cross; detected handedness may appear reversed in a mirrored view. Pixel distances change with perspective. Face.smiling, blink detection, and Pose.arms_raised are heuristics and not robust biometric or safety assessments. Face tracking currently selects the first detected face. Models are downloaded separately; they are not included in the wheel.

Credits and licenses

GesturePlayKit uses MediaPipe, OpenCV and NumPy. MediaPipe models have their own terms. See LICENSE (MIT) for the GesturePlayKit source and Development attribution for its development history.

Metadata

Release files for gestureplaykit 1.2.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 gestureplaykit 1.2.0
File Size Uploaded Provenance Actions
gestureplaykit-1.2.0.tar.gz 54.9 kB Without provenance Details for gestureplaykit-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gestureplaykit 1.2.0
File Interpreter ABI Platform Actions
gestureplaykit-1.2.0-py3-none-any.whl Python 3 none any Details for gestureplaykit-1.2.0-py3-none-any.whl

Total release size: 76.9 kB

Release files / gestureplaykit-1.2.0.tar.gz

Download URL gestureplaykit-1.2.0.tar.gz
Size 54.9 kB
Tags Source
SHA-256 checksum
How to use checksums
06b1c7ecd17e397e1f5865445e1790ba6a0a0e6899c7479129c6666084a7a69b
BLAKE2b-256 checksum
How to use checksums
59be4840ad5f5bf7db7117622c244071cf9245c27049072ee9ffbff2d95d7469
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / gestureplaykit-1.2.0-py3-none-any.whl

Download URL gestureplaykit-1.2.0-py3-none-any.whl
Size 22.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b2e06fba9aeb63758ccb683ada4df4b2f15d3ecb0320448b059bf5214f70b02e
BLAKE2b-256 checksum
How to use checksums
4425ff9dd34ea04b6bc010f37ccee664ed9b33760efdc27fee179316591ee3ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for gestureplaykit 1.2.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.

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