Strike the pose. Beat your opponent. Win the round.
A two-player pose matching game powered by MediaPipe's BlazePose and OpenCV. Players compete side-by-side in front of a single webcam, striking target poses as fast and accurately as they can. An AI judge scores each round in real time based on joint-angle similarity.
| Feature | Description |
|---|---|
| ๐ฎ Two-Player Split-Screen | Single webcam divided into two halves โ Player 1 (left) & Player 2 (right) |
| ๐ฆด Real-Time Skeleton Tracking | Full-body pose estimation via MediaPipe BlazePose (33 landmarks) |
| ๐ Joint-Angle Scoring | 8 key joint angles compared against target poses for precise scoring |
| ๐ฏ 20+ Target Poses | Curated library including dance, yoga, bodybuilding & fun poses |
| ๐ฅ๏ธ Responsive HUD | Modern gradient UI with live scores, round info & performance feedback |
| ๐ Performance Feedback | Instant ratings โ "Perfect Pose!", "Almost There!", or "What was that pose?" |
| ๐ Replay System | Instantly restart a new game after the winner is announced |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ WEBCAM FEED โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโ
โ โ PLAYER 1 โ โ PLAYER 2 โ โ โ TARGET โ
โ โ (Left Half) โ โ (Right Half) โ โ โ POSE โ
โ โ โ โ โ โ โ โ
โ โ ๐ฆด Skeleton โ โ ๐ฆด Skeleton โ โ โ ๐ผ๏ธ Image โ
โ โ Overlay โ โ Overlay โ โ โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ โโโโโโโโโโโโโโ
โ โโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ SCORE HUD BAR โ โ
โ โ P1: 87.3 P2: 72.1 โ โ
โ โ Round 3/5 โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- Countdown โ Each round starts with a 5-second timer
- Pose โ When the timer hits zero, your current body pose is captured
- Score โ Joint angles are extracted and compared to the target pose
- Repeat โ 5 rounds per game, highest total score wins
- Python 3.11 (recommended โ best MediaPipe compatibility)
- A working webcam
- Windows / macOS / Linux
# Clone the repository
git clone https://github.com/VenkataSatyaSai16/POSE-AI.git
cd POSE-AI
# Create a virtual environment
python -m venv venv
# Activate it
# Windows
venv\Scripts\activate
# macOS / Linux
source venv/bin/activate
# Install dependencies
pip install -r requirements.txtpython main.py| Key | Action |
|---|---|
| Space | Start the game from the title screen |
| R | Restart after game over |
| Q | Quit the game |
POSE-AI/
โโโ main.py # ๐ฌ Entry point โ game loop & state machine
โโโ camera.py # ๐ท Webcam capture manager
โโโ pose_detector.py # ๐ฆด MediaPipe BlazePose wrapper
โโโ pose_compare.py # ๐ Joint angle extraction & scoring engine
โโโ game_logic.py # ๐ฎ Round management, scoring & pose loading
โโโ ui.py # ๐ฅ๏ธ HUD, overlays & responsive UI rendering
โโโ pose_targets.json # ๐ฏ Pre-computed target angles per pose
โโโ test.py # ๐งช Test script
โโโ requirements.txt # ๐ฆ Python dependencies
โโโ poses/ # ๐ผ๏ธ Target pose image library
โโโ Bharatanatyam.jpeg
โโโ bodybuilderpose.jpg
โโโ treepose1.jpeg
โโโ michael.webp
โโโ shahrukh.webp
โโโ ... (20+ poses)
The game compares 8 key joint angles between the player's pose and the target:
Left Elbow โโ โโ Right Elbow
Left Shoulderโโค ๐ฆด Body Model โโ Right Shoulder
Left Hip โโค โโ Right Hip
Left Knee โโ โโ Right Knee
Formula:
Score = 100 - mean(|player_angle - target_angle| for each joint)
| Score Range | Feedback |
|---|---|
| 85 โ 100 | โญ Perfect Pose! |
| 60 โ 84 | ๐ Almost There! |
| 0 โ 59 | ๐ What was that pose? |
The game ships with 20+ diverse poses spanning multiple categories:
| Category | Poses |
|---|---|
| ๐ Dance | Bharatanatyam, Classical, Dance Pose 1 & 2 |
| ๐ง Yoga | Tree Pose, Child Pose, Head Down |
| ๐ช Fitness | Bodybuilder Pose, Squat Pose |
| ๐บ Pop Culture | Michael (Jackson), Shahrukh (Khan), Dab Pose |
| ๐ Fun | Fun, Kick, Stylish, Show Them |
Adding your own poses: Drop any image (
.jpg,.jpeg,.png,.webp,.avif) into theposes/folder. The game will automatically detect the pose in the image and use it as a target. For fine-tuned control, add custom angles inpose_targets.json.
| Setting | Location | Default |
|---|---|---|
| Rounds per game | main.py โ TOTAL_ROUNDS |
5 |
| Countdown duration | main.py โ COUNTDOWN_SECONDS |
5.0s |
| Result display time | main.py โ RESULT_SHOW_SECONDS |
2.5s |
| Window size | main.py โ cv2.resizeWindow() |
1280ร720 |
| Camera index | camera.py โ CameraManager() |
0 |
| Pose detection confidence | pose_detector.py |
0.5 |
- MediaPipe โ Google's ML framework for real-time pose estimation (BlazePose, 33 landmarks)
- OpenCV โ Computer vision library for camera capture, image processing & UI rendering
- NumPy โ Efficient numerical computation for angle calculations
Contributions are welcome! Here are some ideas:
- ๐ Add a web-based UI with Flask/Streamlit
- ๐ฑ Mobile support via MediaPipe's lightweight models
- ๐ต Background music & sound effects
- ๐ Score history & leaderboard persistence
- ๐ค Single-player mode with AI opponent
- ๐จ Custom pose creation tool
# Fork & clone
git clone https://github.com/<your-username>/POSE-AI.git
# Create a feature branch
git checkout -b feature/amazing-feature
# Commit & push
git commit -m "Add amazing feature"
git push origin feature/amazing-feature
# Open a Pull Request ๐This project is open source and available under the MIT License.
Built with โค๏ธ and AI
โญ Star this repo if you like it!