How clssty/posture-detection-website works
This repository is a posture-detection application: its main workflow is a user starting a browser posture check, the backend analyzing webcam frames and returning annotated video plus posture-angle classifications. Separate educational pages explain posture risks, corrective posture, measurement angles, and how to perform a check. A second, offline workflow extracts measurements from labeled videos and analyzes classification thresholds. The sampled source supports these boundaries, but not every page’s navigation or the full backend implementation, so uncertain links are omitted.
Main entry points: App.tsx Route dispatcher · server.py FastAPI posture server · extract_dataset.py Video measurement extraction · PostureCheck.tsx Posture check
Components 19
Website
- Route dispatcher
WebsiteBuild/src/App.tsx - Home
WebsiteBuild/src/pages/Home.tsx
Live Posture Check
- Posture check
WebsiteBuild/src/pages/PostureCheck.tsx - FastAPI posture server
Backend/server.py - Latest frame and data
Backend/server.py - Angle calculations
Backend/utils/angle_calculator.py
Posture Education
- Correct posture
WebsiteBuild/src/pages/CorrectBodyPosture.tsx - Posture impacts
WebsiteBuild/src/pages/ImpactOfBadPosture.tsx - Angle information
WebsiteBuild/src/pages/AngleInformation.tsx - Check guide
WebsiteBuild/src/pages/GuideForPostureCheck.tsx
Dataset Analysis
- Labeled video corpus
Backend/dataset - Video measurement extraction
Backend/extract_dataset.py - Pose utilities
Backend/utils/mediapipe_utils.py - Posture measurements
Backend/output/posture_dataset.csv - Threshold analysis
Backend/analyze_threshold.py - Threshold report
Backend/output/threshold_analysis.txt
Other components
- Website visitor
- Webcam
- MediaPipe Pose
Connections 21
- Website visitor → Route dispatcher: opens
- Route dispatcher → Home: routes
- Route dispatcher → Posture check: routes
- Route dispatcher → Correct posture: routes
- Route dispatcher → Posture impacts: routes
- Route dispatcher → Angle information: routes
- Route dispatcher → Check guide: routes
- Website visitor → Posture check: starts check
- Posture check → FastAPI posture server: checks health; opens streams
- Webcam → FastAPI posture server: supplies frames
- FastAPI posture server → MediaPipe Pose: processes frames
- FastAPI posture server → Angle calculations: calculates angles
- FastAPI posture server → Latest frame and data: updates latest values
- Latest frame and data → FastAPI posture server: provides latest values
- FastAPI posture server → Posture check: streams video and JSON
- Labeled video corpus → Video measurement extraction: provides videos
- Video measurement extraction → Pose utilities: creates pose; extracts landmarks
- Video measurement extraction → Angle calculations: calculates measurements
- Video measurement extraction → Posture measurements: writes measurements
- Posture measurements → Threshold analysis: provides measurements
- Threshold analysis → Threshold report: writes analysis