Skip to content

KennethOng02/cfa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CFA — Calisthenic Form Analyzer

A full-stack web app that analyzes videos of calisthenics holds using MediaPipe pose detection, geometric scoring, and LLM-generated coaching feedback.

Supported moves: planche, front lever, back lever, handstand

How It Works

  1. Upload a video and select the move
  2. Frames are extracted at 2 FPS and run through MediaPipe pose detection
  3. The longest stable-pose window is identified
  4. Geometric metrics (angles, alignment, lean) are scored against calibration curves
  5. An LLM generates coaching feedback from the scores
  6. Results are displayed with a skeleton overlay on the best frame and a score trend chart

Setup

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • ffmpeg (for video trimming)

Backend

cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

cp .env.example .env
# Edit .env — set PROVIDER and the matching API key

python -m uvicorn main:app --reload
# Runs on http://localhost:8000

Frontend

cd frontend
npm install
npm run dev
# Runs on http://localhost:5173

Environment Variables

Variable Description
PROVIDER claude | openai | gemini
ANTHROPIC_API_KEY Required when PROVIDER=claude
OPENAI_API_KEY Required when PROVIDER=openai
GOOGLE_API_KEY Required when PROVIDER=gemini
DATABASE_URL Defaults to sqlite:///./cfa.db

Running Tests

cd backend
source venv/bin/activate
pytest -v

Adding a New Move

  1. Create backend/analyzer/moves/<move_name>.py with a METRICS list (each entry: name, label, weight, compute_fn, curve)
  2. Register it in backend/analyzer/moves/__init__.py
  3. Add the move to MoveType in frontend/src/api/types.ts

Tech Stack

  • Backend: FastAPI, SQLAlchemy, MediaPipe, OpenCV, NumPy
  • Frontend: React, TypeScript, Recharts
  • LLM: Anthropic Claude / OpenAI / Google Gemini (configurable)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors