Real-time AI-powered pose detection and movement scoring for the Azerbaijan Capoeira Federation
| Feature | Details |
|---|---|
| π₯ Video Upload Analysis | Upload a training video and get per-movement scores |
| π· Live Camera Mode | Real-time skeleton overlay via your webcam |
| 𦴠Skeleton Overlay | MediaPipe 33-point pose landmarks drawn on video |
| π Movement Scoring | AI scores each Capoeira technique on a 0β10 scale |
| π Detailed Feedback | Color-coded β good / β bad points per movement |
| π― Movement Selector | Choose only the movements in your video before analysis |
| π Performance Chart | Technique score & stability trend per session |
capoeira-movements-analysis-system/
βββ capoeira-analyzer/ # Python FastAPI backend
β βββ api.py # REST API endpoints
β βββ analyzer/
β β βββ pose_detector.py # MediaPipe Tasks API (Python 3.12 β
)
β β βββ angle_calculator.py # Joint angle computation
β β βββ report_generator.py # Session results
β βββ movements/ # Per-movement scorers
β β βββ ginga.py
β β βββ au.py
β β βββ meia_lua.py
β β βββ armada.py
β β βββ bencao.py
β βββ models/
β βββ pose_landmarker.task # MediaPipe lite model
β
βββ capoeira-dashboard/ # Vite + Vanilla JS frontend
βββ index.html
βββ src/
β βββ main.js # UI logic, upload, MediaPipe JS
β βββ style.css # Glassmorphism dark theme
βββ vite.config.js # Dev server + API proxy
- Python 3.12
- Node.js 18+
cd capoeira-analyzer
# Create virtual environment
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # macOS/Linux
# Install dependencies
pip install fastapi uvicorn mediapipe opencv-python numpy pandas
# Download MediaPipe pose model
python -c "
import urllib.request, pathlib
pathlib.Path('analyzer/models').mkdir(parents=True, exist_ok=True)
urllib.request.urlretrieve(
'https://storage.googleapis.com/mediapipe-models/pose_landmarker/pose_landmarker_lite/float16/1/pose_landmarker_lite.task',
'analyzer/models/pose_landmarker.task'
)
print('Model downloaded β
')
"
# Start the API server
python -m uvicorn api:app --host 0.0.0.0 --port 8000API will be live at http://localhost:8000
cd capoeira-dashboard
npm install
npx vite --port 5174 --hostDashboard will open at http://localhost:5174
- Click "Analyze New Video" in the top-right
- Select your video file β it instantly plays in the dashboard
- A movement selector appears β check only the movements in your video
- Click βΆ Start Analysis
- Watch the progress bar while MediaPipe processes every frame
- Results appear: scores, chart, and detailed β /β feedback per movement
- Click the π· Live Camera button on the video panel
- Allow camera permissions in your browser
- The green skeleton will appear on your body in real time
- Click βΉ Stop Camera to end the session
| Movement | Description |
|---|---|
| Ginga | Side-to-side base movement β the heart of Capoeira |
| Au (Cartwheel) | Sideways handstand / cartwheel |
| Meia-lua de Frente | Half-moon front kick |
| Armada | Spinning back kick |
| BΓͺnΓ§Γ£o | Front push kick |
Analyze a video file for selected Capoeira movements.
Form fields:
| Field | Type | Description |
|---|---|---|
file |
video/* |
The video file to analyze |
athlete_name |
string |
Athlete display name |
movements |
string |
Comma-separated movement names |
Response:
{
"athlete_name": "Davud A.",
"session_id": "SESSION-A1B2C3D4",
"overall_score": 7.4,
"detection_stats": {
"detected_frames": 412,
"total_frames": 450,
"detection_rate": 91.5
},
"movements": [
{
"movement_name": "Au (Cartwheel)",
"overall_score": 7.4,
"peak_score": 9.1,
"average_score": 6.8,
"feedback": ["Good arm extension detected", "Knee bend too shallow at peak"]
}
]
}Backend
- FastAPI β REST API framework
- MediaPipe Tasks API β Pose landmark detection
- OpenCV β Video frame extraction
- NumPy β Joint angle mathematics
Frontend
- Vite β Build tool & dev server
- MediaPipe Tasks Vision JS β Client-side real-time pose detection
- Chart.js β Performance charts
- Vanilla JS + CSS (Glassmorphism dark theme)
Dashboard with live skeleton overlay and movement breakdown
Azerbaijan Capoeira Federation Β· Built with β€οΈ and MediaPipe