Inspiration

The AHA 2025 adult basic life support guideline says that "for adults in cardiac arrest, it is reasonable for rescuers to perform chest compressions at a rate of 100 to 120/min." Holding that rate through a two-minute practice round is hard to judge alone: pace drifts and pauses go unnoticed. A 2025 systematic review in Resuscitation Plus ("We identified 20 RCTs with 4579 participants") reports a pooled standardised mean difference of 0.44 (95% CI 0.23–0.66) for rate compliance across nine studies. The goal is live rate feedback from just a browser and a camera.

What it does

CPR Pace Coach is a static web app: you place a camera to your side, begin a two-minute practice on a manikin or cushion, and an on-device pose model tracks your shoulders, elbows and wrists. Wrist motion gives compression rate against the 100–120/min target band, rhythm variation (the coefficient of variation, CV, of the intervals between cycles) and observed hands-off time; the shoulder–elbow–wrist landmarks give a 2D elbow angle (bent below 160°). A large gauge shows the current rate from the latest five cycles; cues such as "Push faster" and "Keep your arms straight" appear as text, plus an optional beat and local voice. At two minutes a one-page summary gives the share of intervals in the target band, average rate, CV, observed stops, arm extension, tracking coverage and one next practice goal.

Everything runs in the browser: no application server, account, analytics or upload; in camera mode the only permitted external connection is the pose-model download from Google, which carries no footage. "Try demo" needs no camera: simulated motion, labelled "Simulated motion" throughout, runs through the same detector; it drifts, stops for three seconds and bends its elbows, so the rate, pause and arm cues all appear.

After a session, Export JSON saves the session metrics and the detector settings behind them, never frames or pose coordinates. Two Model Context Protocol (MCP) tools, running as a small local Node process, let an AI agent read it: summarize_session returns a summary and next practice goals; compare_sessions returns the differences between two sessions, with null where a value is unavailable.

It does not measure compression depth, force or recoil: a single uncalibrated camera with estimated pose cannot establish chest displacement, and the app says so. It does not assess patients or certify anyone.

How I built it

I entered solo; AI coding agents built the code, which the hackathon rules allow, and I made the choices listed below. Two independent AI brainstorming runs produced 14 ideas; an AI agent scored them against the judging criteria and the roughly 150 projects already in the gallery, and I chose three to build from its recommendations, this one among them. I chose the layout from four AI mockups, the PDF from three and the narration voice from four samples.

OpenAI Codex (GPT-6 Astra, via the Codex CLI) wrote the core, tests, evaluation scripts, web interface and recording scripts. Claude Code (Claude Opus 5.5) planned, wrote the briefs, reviewed every change, ran the tests, fixed the defects it found and published the repository. The stack is React, TypeScript and Vite, with MediaPipe Pose Landmarker in WebAssembly; the detector is deterministic signal processing on wrist displacement normalised by shoulder width; results are checked with Zod and a generated JSON Schema; the MCP tools use the official TypeScript SDK over stdio. GPT-6 Pro drafted this text, edited against the repository and sources; the narration is a Gemini text-to-speech voice.

Challenges I ran into

Separating "still" from "not visible": a tracking gap must not become a fake zero or a fake pause, so it splits the observed time, counts as unknown and leaves uncomputable metrics null. Defining a pause honestly: a pause runs from one detected peak to the next (or to the edge of the observed window), so it includes partial cycles and is slightly longer than the stop built into a test. The elbow angle is a 2D projection, and 160° is a prototype threshold, not a medical cutoff.

Finding licensed real footage for the demo: the Welsh Government's "Save a Life Cymru" training film (CC BY 3.0, on Wikimedia Commons) was imported into the live app, but it is filmed from the rescuer's eye level, so the compressing arms show only from the forearms down. A 30-second compression clip gave valid tracking for 21% of the time, 5 wrist cycles and no rate. The demo video therefore stays with labelled simulated motion, and the setup screen asks for a camera to the side with both arms visible.

Accomplishments that I'm proud of

The demo's numbers come from the same detector as camera practice, not from a mockup. On 120-second synthetic sessions at 90, 110 and 130 cycles per minute (cpm) with noise and spikes, the average-rate error was 0.000, 0.011 and 0.006 cpm, and every ground-truth peak was matched. Two imposed stops totalling 8.000 s were detected as two peak-to-peak pauses totalling 9.367 s; 5 s of missing landmarks produced 9 missed peaks and 5.033 s reported as unknown, not zero.

What I learned

Average error is only part of the story: a good session average can coexist with delayed feedback (mean emission latency, from wrist peak to detector report, was 125.897–135.867 ms across cases, since the detector waits for reversal) and with nonzero measured CV for perfectly periodic input, because frames sample time discretely. Each number must keep its meaning: a wrist cycle is not a verified compression, and finishing two minutes is not competence.

What's next

Camera and pose accuracy testing on physical devices, Safari and iOS checks, audible speech checks, and frame-accurate decoding for variable-frame-rate video. Synthetic tests bypass the camera and pose estimation, so real-world accuracy is unmeasured; there has been no user study, clinician review or partnership.

Practice tool only. In a real emergency, call your local emergency number and follow the dispatcher.

Built With

  • claude-code
  • ffmpeg
  • gemini-tts
  • github
  • github-actions
  • json-schema
  • mcp-typescript-sdk
  • mediapipe-tasks-vision
  • model-context-protocol
  • node.js
  • openai-codex
  • playwright
  • react
  • typescript
  • vite
  • vitest
  • web-audio-api
  • web-speech-api
  • webassembly
  • zod
Share this project:

Updates

Submission history