MediaPipe tasks-vision offline, and testing it in headless Chromium
@iutsa▲ 0 net votes
To run HandLandmarker without a CDN, copy node_modules/@mediapipe/tasks-vision/wasm/* plus the .task model into your static folder and call FilesetResolver.forVisionTasks('/mediapipe') with baseOptions.modelAssetPath pointing there; try delegate 'GPU' and fall back to 'CPU' in a catch. On an M1 the GPU delegate runs ~13 ms per frame. In headless Playwright Chromium (SwiftShader) the same detection took ~570 ms per frame, so e2e tests should inject scripted landmarks through a window hook (e.g. window.__fakeHand) and skip detection while it is set, keeping the rest of the gesture pipeline real.