PoseTrack-Real-Time-Pose-Estimation

๐Ÿ‹๏ธโ€โ™‚๏ธ GymPose AI - Real-Time Pose Estimation & Joint Analysis

A cutting-edge fitness application that uses AI-powered computer vision to provide real-time pose estimation, form analysis, and personalized coaching feedback for gym exercises.

โœจ Features

๐Ÿ—๏ธ Architecture

GymPose AI/
โ”œโ”€โ”€ backend/                 # Java Spring Boot Backend
โ”‚   โ”œโ”€โ”€ src/main/java/
โ”‚   โ”‚   โ””โ”€โ”€ com/gympose/
โ”‚   โ”‚       โ”œโ”€โ”€ controller/  # REST API endpoints
โ”‚   โ”‚       โ”œโ”€โ”€ service/     # Business logic & pose estimation
โ”‚   โ”‚       โ”œโ”€โ”€ model/       # Database entities
โ”‚   โ”‚       โ”œโ”€โ”€ dto/         # Data transfer objects
โ”‚   โ”‚       โ””โ”€โ”€ config/      # Security & configuration
โ”‚   โ””โ”€โ”€ pom.xml             # Maven dependencies
โ”œโ”€โ”€ frontend/               # React.js Frontend
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/     # Reusable UI components
โ”‚   โ”‚   โ”œโ”€โ”€ pages/          # Application pages
โ”‚   โ”‚   โ”œโ”€โ”€ contexts/       # React contexts
โ”‚   โ”‚   โ””โ”€โ”€ services/       # API integration
โ”‚   โ””โ”€โ”€ package.json        # Node.js dependencies
โ””โ”€โ”€ README.md               # This file

๐Ÿš€ Quick Start

Prerequisites

Backend Setup (Java)

  1. Navigate to backend directory:
    cd backend
    
  2. Install dependencies:
    mvn clean install
    
  3. Run the application:
    mvn spring-boot:run
    
  4. Access the API:
    • Backend: http://localhost:8080/api
    • H2 Database Console: http://localhost:8080/h2-console
    • API Documentation: http://localhost:8080/swagger-ui.html

Frontend Setup (React)

  1. Navigate to frontend directory:
    cd frontend
    
  2. Install dependencies:
    npm install
    
  3. Start development server:
    npm start
    
  4. Access the application:
    • Frontend: http://localhost:3000

๐Ÿ”ง Configuration

Backend Configuration

Edit src/main/resources/application.yml:

server:
  port: 8080
  servlet:
    context-path: /api

spring:
  datasource:
    url: jdbc:h2:mem:gympose_db  # Change to PostgreSQL for production
    username: sa
    password: password

jwt:
  secret: your-super-secret-jwt-key-change-in-production
  expiration: 86400000

Frontend Configuration

Edit src/services/api.js:

const API_BASE_URL = 'http://localhost:8080/api';

๐Ÿ“ฑ Usage

1. User Registration & Login

2. Exercise Selection

3. Real-Time Pose Detection

4. Progress Monitoring

๐Ÿง  How It Works

Pose Estimation Algorithm

  1. Frame Capture: Real-time video stream from device camera
  2. Landmark Detection: OpenCV-based pose landmark identification
  3. Angle Calculation: Mathematical computation of joint angles
  4. Form Analysis: AI-powered exercise technique evaluation
  5. Feedback Generation: Instant coaching tips and corrections

Key Metrics

๐Ÿ—„๏ธ Database Schema

Core Entities

Relationships

User (1) โ†โ†’ (Many) ExerciseSession
ExerciseSession (1) โ†โ†’ (Many) PoseData
User (1) โ†โ†’ (Many) WorkoutPlan

๐Ÿ”’ Security Features

๐Ÿ“Š API Endpoints

Authentication

Pose Detection

Exercise Management

๐ŸŽฏ Exercise Types

1. Knee Bend

2. Squat

3. Deadlift

4. Lunge

๐Ÿš€ Deployment

Production Backend

  1. Build JAR file:
    mvn clean package -DskipTests
    
  2. Run with Java:
    java -jar target/gympose-ai-backend-1.0.0.jar
    
  3. Environment variables:
    export SPRING_PROFILES_ACTIVE=production
    export DATABASE_URL=jdbc:postgresql://localhost:5432/gympose
    export JWT_SECRET=your-production-secret
    

Production Frontend

  1. Build production bundle:
    npm run build
    
  2. Serve static files:
    npx serve -s build -l 3000
    

๐Ÿงช Testing

Backend Tests

cd backend
mvn test

Frontend Tests

cd frontend
npm test

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

๐Ÿ“ž Support

๐Ÿ”ฎ Future Enhancements


Built with โค๏ธ for the fitness community

Transform your workouts with AI-powered coaching!