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.0.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.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for gesturenav-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1a637527a3987f174183cba3e6d25c78d231cb09e12a507adecdbcd7618471b0
MD5 ab6dc8cd64b6c071afe0c36f41d8019f
BLAKE2b-256 c28773908abd2870a4e98dbf4aa060c9b41648b2851bfb18e9cc59a18196e65e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for gesturenav-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a2bd7fc0f609a00ccd9994d09ee08caa0113e4b17d04f7c274c37766858cf60
MD5 a51fc5df1dd3fe9fd18f82eb77f19325
BLAKE2b-256 e5bd8790214f12875b6205c33aa05e8697d2756ac03b620f6a302e108a2abe51

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

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