micro-handpose

WebGPU-powered hand tracking in an 8KB bundle. Zero dependencies.

npm i @svenflow/micro-handpose

Live Demo

Hand tracking powered by WebGPU

Status
Idle
FPS
Inference (avg)
Hand

Landmark Comparison: micro-handpose vs MediaPipe

At a Glance

8KB
Gzipped bundle
(37KB minified)
2.2ms
Inference on M4
0
Dependencies
TS
Full TypeScript

vs MediaPipe Download Size

micro-handpose MediaPipe
Runtime 37KB JS 11MB WASM + 334KB JS
Model weights 7.7MB
(.bin + .json)
7.5MB
(.task file)
Total ~7.7MB ~18.8MB

Usage

example.ts
import { createHandpose } from '@svenflow/micro-handpose'

// Initialize once (downloads weights, compiles WebGPU pipeline)
const handpose = await createHandpose()

// Detect from any image source: canvas, video, image, ImageData
const hands = await handpose.detect(videoElement)

for (const hand of hands) {
  console.log(hand.keypoints.index_tip) // {x, y, z}
  console.log(hand.handedness)          // 'left' | 'right'
}

// Clean up GPU resources when done
handpose.dispose()