feat(handtracking): restyle svg visualizer and add silhouette fallback

This commit is contained in:
Tom Boullay
2026-06-02 19:05:39 +02:00
parent 4de86f4e58
commit ae35eb1dfb
8 changed files with 207 additions and 16 deletions
+7 -1
View File
@@ -14,7 +14,7 @@ export const HAND_TRACKING_BROWSER_WASM_URL =
"https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.35/wasm";
export const HAND_TRACKING_BROWSER_MODEL_URL =
"https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/1/hand_landmarker.task";
export const HAND_TRACKING_BROWSER_DELEGATE: "CPU" | "GPU" = "CPU";
export const HAND_TRACKING_BROWSER_DELEGATE: "CPU" | "GPU" = "GPU";
// Delay before the runtime actually starts after `enabled` flips to true.
// Absorbs React StrictMode's mount/unmount/mount cycle in dev and rapid
@@ -26,3 +26,9 @@ export const HAND_TRACKING_RUNTIME_START_DELAY_MS = 80;
// to initialize webcam + model + first frame inference before we cleanup,
// so the user actually sees their hands when entering a zone briefly.
export const HAND_TRACKING_LINGER_MS = 2000;
// EMA weight applied to the latest landmark frame. Lower = smoother but
// laggier; higher = more responsive but more jitter from raw MediaPipe
// noise. 0.4 keeps the glove and grabbed objects from trembling without
// feeling sluggish.
export const HAND_TRACKING_LANDMARK_SMOOTHING = 0.4;