Skip to main content

gesturenav

Touchless pan / orbit / zoom camera control from hand-landmark gestures.

Turns a stream of hand landmarks (e.g. from MediaPipe's HandLandmarker) into camera-control deltas your app can apply to a 3D viewer, using held poses instead of clicks and drags:

Pose Action
✌️ V-sign, then swipe Orbit
✋ Open palm, then swipe Pan
🤏 Pinch, drag vertically Zoom
🤙 Shaka, held Toggle (e.g. switch camera mode)

Built for touchless / hands-free 3D navigation — useful for kiosks, AR/VR interfaces, and as an alternative input method for people who can't reliably use a mouse or trackpad.

Zero required dependencies — pure Python, math and dataclasses only. Bring your own hand-tracking source (MediaPipe, or anything else that produces 21 landmarks per hand).

Install

pip install gesturenav

Usage

from gesturenav import GestureController

controller = GestureController()

# hands: a list of 0-2 hands, each a sequence of 21 landmark objects
# with .x, .y, .z attributes in normalized [0, 1] image coordinates
# (this is exactly what MediaPipe's HandLandmarker.detect() returns
# via result.hand_landmarks).
state = controller.update(hands)

if state.mode == "pan":
    camera.pan(state.delta_x, state.delta_y)
elif state.mode == "orbit":
    camera.orbit(state.delta_x, state.delta_y)
elif state.mode == "zoom":
    camera.zoom(state.zoom_delta)

if state.toggle_id != last_toggle_id:
    camera.switch_mode()
    last_toggle_id = state.toggle_id

Call controller.update([]) (or just let an empty/no-hand frame through) when tracking is lost — it clears motion history so the next gesture doesn't inherit stale momentum.

Tuning

GestureController(
    pose_lock_secs=0.5,    # how long a pose must be held before it "arms"
    swipe_thresh=0.022,    # min normalized motion per frame to trigger a swipe
    ema_alpha=0.6,         # smoothing factor for hand position (higher = snappier)
    toggle_hold_secs=0.6,  # how long a shaka must be held to fire a toggle
    toggle_cooldown=2.0,   # min seconds between toggle fires
)

Pose classification only

If you just want the raw pose classification without the stateful swipe/toggle tracking:

from gesturenav import classify_hand

pose = classify_hand(one_hand_landmarks)
pose.is_fist, pose.is_open, pose.is_pinch, pose.v_sign, pose.palm_open, pose.shaka

Development

pip install -e ".[dev]"
pytest

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gesturenav-0.1.1.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gesturenav-0.1.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file gesturenav-0.1.1.tar.gz.

File metadata

  • Download URL: gesturenav-0.1.1.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.5

File hashes

Hashes for gesturenav-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ee293c08c235b80293c2b0a15568abddae3579aa01e7c33b93928a4662bb3f6f
MD5 3b0be234b4df0d2c1119660a8e5f2024
BLAKE2b-256 873ab8696fd81744673270c13a3cb296e7fa2f643fd4d6c5c1aba990c219ed88

See more details on using hashes here.

File details

Details for the file gesturenav-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: gesturenav-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.5

File hashes

Hashes for gesturenav-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 747c93858ada2109882e9a5da53f4326ea9937fbdf16add2b0124e2006b45f41
MD5 c6054519b43f0c36ecb6dff4e1d5bf1e
BLAKE2b-256 d3c9eaf30587247668abfe3152b3ad0d53d9e089d88e0ff0f9c87727755b1b65

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 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