fix(handtracking): bump browser camera to 640x480 for detection

The browser MediaPipe model (hand_landmarker.task float16) was failing
to detect hands at 320x240 — MediaPipe ran for 10s straight without
ever returning a hand. Bumping the requested camera resolution to
640x480 (browser only — backend still ships 320x240 JPEGs over the
WebSocket) makes the model reliably pick hands up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tom Boullay
2026-06-02 17:39:43 +02:00
parent d9cacdad12
commit 73c6d7d50d
2 changed files with 10 additions and 4 deletions
+6
View File
@@ -1,5 +1,11 @@
export const HAND_TRACKING_FRAME_WIDTH = 320;
export const HAND_TRACKING_FRAME_HEIGHT = 240;
// The browser MediaPipe model (hand_landmarker.task float16) is more
// sensitive than the backend Python model and needs a higher-resolution
// frame to detect hands reliably. The backend keeps 320x240 because that
// is the JPEG payload size sent over the WebSocket.
export const HAND_TRACKING_BROWSER_CAMERA_WIDTH = 640;
export const HAND_TRACKING_BROWSER_CAMERA_HEIGHT = 480;
export const HAND_TRACKING_TARGET_FPS = 10;
export const HAND_TRACKING_JPEG_QUALITY = 0.55;
export const HAND_TRACKING_CAMERA_TIMEOUT_MS = 8_000;