How ad25600/bharatnatyam-coach works
Natya Drishti is a browser-based Bharatanatyam pose coach backed by FastAPI, MediaPipe, and a Random Forest classifier. A user uploads an image or captures a webcam frame; the UI submits it to /predict, and the backend detects landmarks, classifies the pose, measures joint deviations, and returns feedback plus a highlighted image for the UI to display. The graph preserves the input, inference, and result stages, along with model/configuration responsibilities. Connections reflect shown calls or README-documented HTTP behavior; training and model-stat generation are outside the runtime workflow.
Main entry points: App.jsx App state · predictor.py Pose assessment · InputStage.jsx Image input · WebcamCapture.jsx Webcam capture
Components 16
User experience
- App state
frontend/src/App.jsx - Header
frontend/src/components/Header.jsx - Image input
frontend/src/components/InputStage.jsx - Webcam capture
frontend/src/components/WebcamCapture.jsx - Result display
frontend/src/components/ResultStage.jsx - Accuracy gauge
frontend/src/components/ArchGauge.jsx
API transport
- API client
frontend/src/api.js - Predict endpoint
bharatnatyam_backend/main.py
Pose inference
- Pose assessment
bharatnatyam_backend/app/predictor.py - Landmark detection
bharatnatyam_backend/app/pose_detector.py - Model and statistics
bharatnatyam_backend/app/model_loader.py - Pose highlighting
bharatnatyam_backend/app/visualization.py
Runtime configuration
- Inference settings
bharatnatyam_backend/app/config.py - Landmarker task
bharatnatyam_backend/models/pose_landmarker_full.task
Other components
- Dancer
- Browser camera
Connections 17
- Dancer → Image input: provides image
frontend/src/components/InputStage.jsx - Image input → Webcam capture: offers capture
frontend/src/components/InputStage.jsx - Webcam capture → Browser camera: captures from
frontend/src/components/WebcamCapture.jsx - Webcam capture → Image input: returns frame
frontend/src/components/InputStage.jsx - App state → Header: renders
frontend/src/App.jsx - App state → Image input: renders
frontend/src/App.jsx - App state → Result display: passes result
frontend/src/App.jsx - App state → API client: requests analysis
frontend/src/App.jsx - Result display → Accuracy gauge: renders accuracy
frontend/src/components/ResultStage.jsx - API client → Predict endpoint: posts image
frontend/src/api.js - Predict endpoint → Pose assessment: calls
bharatnatyam_backend/main.py - Pose assessment → Landmark detection: detects landmarks
bharatnatyam_backend/app/predictor.py - Pose assessment → Model and statistics: predicts and reads ranges
bharatnatyam_backend/app/predictor.py - Pose assessment → Pose highlighting: highlights deviations
bharatnatyam_backend/app/predictor.py - Landmark detection → Inference settings: reads settings
bharatnatyam_backend/app/pose_detector.py - Model and statistics → Inference settings: reads artifact paths
bharatnatyam_backend/app/model_loader.py - Landmark detection → Landmarker task: loads model