Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.1.4 instead.

OpenHandTrack — Python

Real-time 3D hand tracking for Python, wrapping MediaPipe's Hand Landmarker task behind a small, clean API — no fighting mediapipe.tasks internals.

  • 21 landmarks per hand (x, y, z), up to 2 hands
  • Handedness with confidence, mirrored-camera quirk handled for you
  • Gesture helpers (is_fist, is_open_palm, is_pinch, …)
  • One-Euro smoothing so the tracking feels solid instead of twitchy
  • Auto-downloads the model on first use (cached locally, not in git)
  • Works on macOS, Windows, Linux — pure stdlib for model download

Install

python -m venv .venv
.venv/bin/pip install -e "python/[examples]"   # library + example deps

Requires Python 3.11+. The mediapipe wheel pulls in numpy + opencv-python automatically.

Hello world

import cv2
from openhandtrack import HandTracker

cap = cv2.VideoCapture(0)
with HandTracker() as tracker:            # model auto-downloads on first run
    while True:
        ok, frame = cap.read()
        if not ok:
            break
        result = tracker.process(frame)   # BGR frame in, clean result out
        print(f"{len(result)} hand(s)", *(h.handedness for h in result))
        cv2.imshow("tracking", frame)
        if cv2.waitKey(1) == ord("q"):
            break
cap.release()

result.hands is empty (never an error) when no hand is in frame.

API at a glance

Symbol What it is
HandTracker(max_hands, min_detection_confidence, min_tracking_confidence, running_mode, mirrored) The main class. Context manager; running_mode supports "VIDEO" and "LIVE_STREAM".
HandTracker.process(frame) -> HandResult Track one BGR numpy frame.
HandResult .hands, len(), iter(), truthy when a hand is present.
Hand .landmarks (21×Landmark), .handedness ("Left"/"Right"), .confidence, .world_landmarks.
Landmark .x, .y, .z in normalized units.
LandmarkSmoother(num_hands, min_cutoff, beta, …) One-Euro smoothing across frames. smoother.update(result.hands) → smoothed hands.
OneEuroFilter / ExponentialMovingAverage Raw filters, if you want them standalone.
gestures.count_extended_fingers(hand) 0–5.
gestures.is_fist(hand) / is_open_palm(hand) Boolean pose checks.
gestures.is_pinch(hand, threshold) (bool, distance) — distance is useful for pinch-to-grab.
gestures.pinch_distance(hand) Thumb↔index gap normalized by hand size.
gestures.pointing_direction(hand) (dx, dy) unit vector of the index finger.

Full docstrings live in the source (openhandtrack/tracker.py, smoothing.py, gestures.py) — that's the reference.

The mirrored-camera quirk

MediaPipe labels handedness assuming the input image is mirrored (a selfie-style webcam feed). HandTracker defaults to mirrored=True to match the common "mirror your webcam view" setup. If you process unmirrored frames (rear camera, video files), pass mirrored=False and the labels are swapped for you. Hold up your right hand: if it reports Left, flip the flag.

Examples

Short, readable projects that reuse this library — see examples/:

  • air_draw/ — pinch to draw in the air, palm to lift, fist to clear.
  • volume_control/ — thumb/index spread controls system volume (with a platform-agnostic mock fallback).
  • presentation_remote/ — swipe gestures send arrow keys to your slides.

Tests

.venv/bin/python -m pytest python/

License

Apache-2.0 — same as MediaPipe, so you can build on it freely.

Metadata

Release files for openhandtrack 0.1.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 openhandtrack 0.1.1
File Size Uploaded
openhandtrack-0.1.1.tar.gz 23.1 kB Details

Built distribution (wheel)

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

Total release size: 43.9 kB

Release files / openhandtrack-0.1.1.tar.gz

Download URL openhandtrack-0.1.1.tar.gz
Size 23.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7b990042b39d41575c27591a9c10ad66c9362fb84ecaadf9715bbf23663d79d7
BLAKE2b-256 checksum
How to use checksums
d94391d1dec646f8087e4ec1d9d531f0ff2101102049700e3d2c00d50bd2ccdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

Release files / openhandtrack-0.1.1-py3-none-any.whl

Download URL openhandtrack-0.1.1-py3-none-any.whl
Size 20.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb2f6c9e9c351d0af0b19b3cae82ab3f727842d8dc67219bcfdba1025ad2d043
BLAKE2b-256 checksum
How to use checksums
0f3a6d3e9aa14a14450d7853da00481d27a77f2c2e62f02ec859aa66a875956b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 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