How purusottamsaha2024/yoga_virtual_teacher works
Project Type and Purpose
• This is a small full-stack, Python-based pose-estimation web application with a separate data-processing and model-training pipeline.
• From the README and file tree:
• app.py plus templates/ and static/ indicate a Flask (or similar) web server exposing an HTML/JS UI.
• A suite of scripts (poseLandmark_csv.py, create_landmarks.py, create_angles.py, calc_angles.py, outliers_removal.py, recommendations.py) ingest raw image data, extract joint landmarks, compute joint angles, clean outliers, and produce recommendations.
• poseModel.py trains a Keras model (model.h5) from the generated CSV data.
File Structure Analysis
• Top-level:
• Dataset/ & poses_dataset/: raw images and precomputed landmarks/angles for each pose class.
• .csv files & csv_files/: intermediate datasets (landmarks.csv, poses_angles.csv, refined_pose_angles_with_tolerance.csv).
• model.h5: trained ML model.
• app.py, detection.py, recommendations.py: serving scripts.
• templates/index.html & static/main.js: front-end presentation.
• No external microservices or databases; data lives in files.
Key Architectural Patterns
• Separation of Concerns:
• Data-processing pipeline (scripts that generate CSVs and train the model)
• Model-serving Web application
• Batch pipeline for training vs. request/response pipeline for inference.
Main Components
a. Data Ingestion & Processing Pipeline
• Component: Dataset (images folder)
• poseLandmark_csv.py → create_landmarks.py → create_angles.py → calc_angles.py → outliers_removal.py → recommendations.py
• Artifacts: landmarks.csv, poses_angles.csv, refined CSVs
b. Model Training
• Component: poseModel.py
• Input: refined CSV data
• Output: model.h5
c. Model Serving (Web Application)
• Component: app.py + detection.py
• UI Layer: templates/index.html + static/main.js
• ML Component: loads model.h5, detection pipeline (landmark extraction + angle calc), and recommendation logic
d. User & Browser
• User interacts with front-end in a browser, images uploaded to app.py
e. Storage
• File‐system storage for CSVs, model artifacts
Relationships & Data Flow
1. Raw Images → Data-Processing Scripts → CSV Files
2. CSV Files → Training Script → model.h5
3. model.h5 + Real-Time Image Input → Inference Scripts → Recommendations
4. Inference Results → Front-end → User
Technologies & Frameworks
• Python scripts (poseLandmark_csv.py, etc.)
• TensorFlow/Keras (model.h5)
• Flask (app.py)
• HTML/JS (templates/index.html, static/main.js)
• File system for storage