How the deep squat prototype worked: rule-based scoring, published thresholds, and dual-angle analysis. This work is paused; the page is kept as documentation of what was built.
How the prototype's pipeline is structured. The code is available on GitHub.
dynalytics/
├── src/ # Core pose analysis engine
│ ├── core/
│ │ ├── landmark.py # Landmark class (x, y, z, visibility)
│ │ └── angle.py # Angle calculation (3 points → degrees)
│ ├── pose/
│ │ └── estimator.py # PoseEstimator (wraps MediaPipe)
│ ├── analysis/
│ │ ├── joint_analyzer.py # 12 joint angle calculations
│ │ ├── velocity.py # Speed + velocity tracking
│ │ └── frame_data.py # FrameData container
│ ├── export/
│ │ └── csv_exporter.py # CSV export (raw, minimal, landmarks)
│ └── config/
│ └── settings.py # Angle definitions & thresholds
│
├── fms/ # Movement scoring engine
│ ├── scoring/
│ │ ├── deep_squat.py # Rule engine: CSV → score 0-3
│ │ ├── dual_angle.py # Front + side → merged score
│ │ └── thresholds.py # Research-backed angle thresholds
│ ├── reporting/
│ │ ├── report_generator.py # Clinical report generation
│ │ └── templates.py # Report prompt templates
│ ├── billing/
│ │ └── cpt_codes.py # Billing categories + CPT suggestions
│ ├── ehr/ # EHR integration layer
│ │ ├── payload.py # AssessmentPayload schema
│ │ ├── adapter.py # Abstract gateway interface
│ │ ├── medstatix.py # MedStatix gateway
│ │ ├── events.py # Webhook event types
│ │ ├── clinic_codes.py # Clinic billing code cache
│ │ └── approval.py # Provider approval workflow
│ ├── disclaimer.py # Clinical + billing disclaimers
│ ├── integration.py # FastAPI hooks
│ └── pipeline.py # CLI: CSV → score + report + billing
│
├── data_collection/
│ ├── backend/ # FastAPI server
│ │ ├── src/
│ │ │ ├── labeling/ # Video, Assessment, FrameTag models
│ │ │ ├── auth/ # Supabase auth (JWT, roles, tokens)
│ │ │ └── web/
│ │ │ └── api.py # REST endpoints
│ │ └── migrations/
│ │ └── 001_initial_schema.sql
│ └── frontend/ # React assessment app
│ └── src/
│ ├── components/
│ │ ├── AssessmentUpload.jsx # Two-slot upload (front + side)
│ │ ├── AssessmentProcessing.jsx # Loading state
│ │ ├── AssessmentResults.jsx # Score + criteria display
│ │ ├── VideoPlayer.jsx # Video playback
│ │ └── SkeletonOverlay.jsx # Pose overlay on video
│ ├── lib/
│ │ └── supabase.js
│ ├── services/
│ │ └── PoseExtractor.js # Client-side MediaPipe JS
│ └── store/
│ ├── useStore.js
│ └── useAuthStore.js
│
├── main.py # CLI pose extraction
└── requirements.txtsrc/ is the core pose analysis engine — it handles pose estimation via MediaPipe, calculates 12 joint angles per frame, tracks speed and velocity, and exports raw data to CSV.
fms/ is the movement scoring engine. It takes the pose data and runs it through a rule-based scoring system with published thresholds, then generates reports. The billing and integration modules in the tree were exploratory scaffolding and were never used with real patients or a real clinic.
data_collection/ is the web application: a React frontend where a user uploads video and a FastAPI backend that orchestrates the pipeline.
Video never leaves the browser. MediaPipe JS runs pose extraction entirely client-side — no video is uploaded to any server.
The scoring engine is rule-based, not a black box. Every threshold has a published source, and every score is explainable.
The deep squat is scored 0–3 following standard Functional Movement Screening protocol:
Performs movement correctly without compensation
Completes with compensations (heels rise, excessive forward lean)
Unable to complete the movement pattern
Pain reported during any part of the movement
Measured by knee flexion angle. Score 3 requires >120° of knee flexion at the deepest point.
The angle of the trunk relative to the tibia. Excessive forward lean indicates compensation.
Detected from the front view. Identifies knee valgus (inward collapse) or varus (outward drift).
Measured by ankle dorsiflexion angle. Heels rising off the ground is a common compensation pattern indicating limited ankle mobility.
Trunk angle change from standing to the deepest point of the squat. Excessive lumbar flexion ("butt wink") indicates poor core or hip mobility.
These angle thresholds are derived from peer-reviewed biomechanics research:
Established normative joint angle ranges for FMS deep squat scoring across score levels 1–3. This study measured actual joint angles across a large sample of participants scored by certified FMS practitioners.
Validated biomechanical criteria for computer vision–based movement screening, confirming that pose estimation can reliably replicate manual FMS scoring.
| Measurement | Score 1 | Score 2 | Score 3 |
|---|---|---|---|
| Knee flexion | ~84.7° | ~110° | >120° |
| Hip flexion | ~88.1° | ~117.5° | — |
| Ankle dorsiflexion (heel rise) | — | <140° | ≥140° |
The system also computes bilateral asymmetry — comparing left vs. right joint angles frame-by-frame and flagging significant differences. This supports clinical identification of compensatory movement patterns that may not be visible to the naked eye.
A single camera angle can't capture all movement faults. The prototype uses two views — front and side — scored independently and merged at the criterion level.
Patient films from FRONT
MediaPipe extracts pose
(client-side, in browser)
Front-view scoring:
Patient films from SIDE
MediaPipe extracts pose
(client-side, in browser)
Side-view scoring:
(each criterion scored by its optimal view)
Video never leaves the browser. MediaPipe JS runs pose extraction entirely client-side. No video is uploaded to any server, ever.
The front view detects knee alignment (valgus/varus) and bilateral asymmetry. The side view measures squat depth, torso position, heel rise, and lumbar control. Neither view alone can see everything.
The system doesn't average the two views or pick the "better" one. It selects the optimal view for each specific biomechanical criterion and merges results at that level. Front view data is authoritative for knee alignment; side view data is authoritative for depth.
The design treats every automated score as a draft. A reviewer sees the findings and the raw angles, can override any criterion, and approves the result. The principle is that the tool informs and a person decides. The prototype was not evaluated by any regulator and was not used in clinical care.
The prototype is kept online as a demonstration and is not maintained.
Open the prototype