packages/model-driver-mediapipe/references/tasks-vision-api.md
This package targets @mediapipe/tasks-vision (web, JS/TS).
import { FilesetResolver, PoseLandmarker } from '@mediapipe/tasks-vision'
const vision = await FilesetResolver.forVisionTasks(wasmRoot)
const pose = await PoseLandmarker.createFromOptions(vision, {
baseOptions: { modelAssetPath: poseModelUrl },
runningMode: 'VIDEO',
numPoses: 1,
})
MediaPipe Tasks Vision detectForVideo() runs synchronously and can block the main thread.
const nowMs = performance.now()
const res = pose.detectForVideo(videoEl, nowMs)
res.landmarks: NormalizedLandmark[][] (take [0] for single person){ x, y, z, visibility?, presence? } with x/y in [0..1]res.landmarks: NormalizedLandmark[][] (each entry is 21 landmarks for one hand)res.handedness: Category[][] aligned with landmarks
handedness[i][0].categoryName is typically 'Left' | 'Right'handedness[i][0].score is confidenceres.faceLandmarks: NormalizedLandmark[][] (468 landmarks, heavy)