How Sports Form Coach Works
Unlike single-person hand/face mocap demos, Sports Form Coach tracks multiple athletes simultaneously,
computes bilateral biomechanical joint angles, and fuses dense RAFT optical flow velocity vectors across
consecutive frames — all locally in dedicated Web Workers.
1. RTMO-s & MoveNet MultiPose (Raw ORT 1.21.0 WASM)
Stage 0 live Chrome probing showed Transformers.js 3.7.5 lacks native rtmo and
movenet classes and its quantized int8 graphs fail on missing WASM
ConvInteger(10) ops (while MoveNet fp16 collapses scores to zero on WASM).
Running Xenova/RTMO-s (fp16, 19.9 MB, matching fp32 to 3 decimals)
and Xenova/movenet-multipose-lightning (fp32, 19.0 MB, ~35 ms/frame) directly in
ONNX Runtime Web 1.21.0 delivers zero-NaN multi-athlete COCO-17 skeletons on every device.
2. Joint-Angle Protractor & Symmetry Audit
coach-core.mjs computes 3-point vector interior angles for Left/Right Knee Flexion
(hip→knee→ankle), Hip Hinge (shoulder→hip→knee), Elbow Extension (shoulder→elbow→wrist), and Torso Lean
from vertical, tracks stable Athlete #1/#2/#3 IDs across frames via nearest-centroid matching, and flags
Left-vs-Right bilateral drift above 8° and 16°.
3. Reused RAFT Optical Flow & Safe Reports
Stage 2 instantiates the site's built ../../models/raft-optical-flow/worker.js to recover a
full [1, 2, 360, 480] displacement field between adjacent frames, maps mean and peak speed
(px/frame) onto each athlete's body box, and exports annotated PNGs plus OWASP formula-neutralized CSV and
JSON coaching reports.