โ† All models ยท ViTPose

Multi-model ยท detector โ†’ ViTPose

Pose estimation for a whole scene

ViTPose is top-down: it estimates one person per box. To handle a crowd, first find the people. This pairs YOLOS-tiny (object detection) with ViTPose โ€” the detector boxes every person, then ViTPose runs on each crop. Two models, one pipeline, entirely on your device.

Run the pipeline

Loads two models: YOLOS-tiny (~30 MB) for detection and ViTPose (~87 MB) for pose. Cached after first load.

Drop a photo with one or more people, or click to choose
Football players on a pitch A person in a yoga warrior pose
0.60

How the two models connect

const people = (await detector(image, { threshold }))          // YOLOS-tiny
  .filter(d => d.label === "person");

for (const d of people) {                                        // one crop per person
  const [x, y] = [d.box.xmin, d.box.ymin];
  const crop = await image.crop([x, y, d.box.xmax, d.box.ymax]); // ViTPose resizes the whole input,
  const box  = [[[0, 0, crop.width, crop.height]]];              // so we crop the box ourselves
  const { heatmaps } = await model(await processor(crop, { boxes: box }));
  const [p] = processor.post_process_pose_estimation(heatmaps, box)[0];
  // p.keypoints are in crop-space โ†’ add [x, y] to map back to the full image.
}

Next

โ† Basics

Read the raw 17 keypoints.

Practical โ†’

Joint angles & form feedback.

Wild โ†’

Stick-figure puppet.