How our clinical deep squat assessment works: rule-based scoring, research-backed thresholds, and dual-angle analysis.
Full transparency — here's exactly how the assessment pipeline is structured. Our codebase is open source and 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 research-backed thresholds, generates clinical reports, maps billing categories, and handles the EHR integration layer.
data_collection/ is the web application — a React frontend where patients upload 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.
Our 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. Our system 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 automated score lands as a "draft" in the provider's dashboard. A licensed provider reviews the findings, can override any criterion, and approves the assessment before it reaches the patient chart. This keeps the system compliant with FDA Clinical Decision Support guidelines — the tool informs, the clinician decides.
Try the movement assessment yourself and see how the dual-angle system scores a deep squat in real time.
Try the assessment yourself