Skip to content

A Python-based virtual personal trainer that uses motion recognition to count exercise reps, track workout history, and provide voice prompts. Users can create accounts, customize settings, and build personalized workout plans—all in an intuitive interface.

License

Notifications You must be signed in to change notification settings

0Swat/Virtual-personal-trainer-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏋️ Virtual-personal-trainer-Python 🏋️

📋 Description

This engineering thesis presents a Python-based computer application acting as a virtual personal trainer. Its main purpose is to monitor user exercises and automatically count the number of repetitions performed.

The application allows users to create accounts and store training history in a database. Each user can add new exercises (counted manually) and build their own workout plans. Additionally, there is an option to customize various settings, such as the repetition counting mode or the volume level of voice prompts.

By combining motion recognition technology with a user-friendly interface, the program continuously analyzes body movements and facilitates efficient training. Users can exercise conveniently while the application ensures correct exercise performance and keeps all necessary data for tracking progress.

📂 Technologies

  • Python
  • OpenCV
  • PyQt
  • SQLite
  • OpenCV
  • ElevenLabs

🚀 Main Features

  • User registration and login with unique username and 4-digit PIN
  • Add and remove custom exercises
  • Create, edit, and delete custom workout plans
  • View training history with calendar overview
  • Application settings configuration (camera, volume, mode, user name, repetition/prep time, account deletion)
  • Camera-based exercise tracking with automatic repetition counting
  • Exercise correctness evaluation (for "Overhead Press" only)
  • Manual and automatic exercise modes without camera tracking

💪 Starting a Workout

After selecting the desired workout plan, the user starts the training session. If the plan includes exercises with motion tracking implemented, the application automatically counts correctly performed repetitions.

For exercises without this feature, the user must manually monitor their execution - optionally using automatic mode, which sets the exercise pace, or manual mode, where the user manually switches between exercises.

Once the workout is completed, it is saved to the history, allowing progress tracking over time.

📸 Application Screenshots

Main App:

Login Page Main Page
History Page Exercises Page
Workout Plans Settings Page

Tracking:

pajacyki_down ohp_down
curl_down squat_up

🛠️ Installation & Setup

✅ System Requirements

  • Windows 10 or newer
  • Python 3.8+ (Python 3.8 is recommended for compatibility)
  • Webcam (built-in or external)

📦 Python Installation

  1. Check if Python is installed by running: python --version
  2. If not installed or version is lower than 3.8, download it from: https://www.python.org/downloads/
  3. Run the installer and make sure to check the option: Add python.exe to PATH
  4. After installation, confirm it by running: python --version

🧪 Virtual Environment Setup

  1. Copy the project files to any folder on your computer.
  2. Open a terminal in that folder and install virtualenv: pip install virtualenv
  3. Create a virtual environment: virtualenv .venv
  4. Activate it: .venv\Scripts\activate
  5. After finishing work, deactivate it with: .venv\Scripts\deactivate

📚 Installing Dependencies

With the virtual environment activated, run: pip install -r requirements.txt

▶️ Running the Application

Method 1: Using Python

  1. Ensure .venv is activated.
  2. Navigate to the folder with main.py.
  3. Run: python main.py
  4. The login window should appear.

Method 2: As a Standalone Executable (via PyInstaller)

  1. Note: The virtual environment must be named .venv – the build script uses hardcoded paths.
  2. Make sure all dependencies are installed in .venv.
  3. Open terminal in the folder containing build.bat.
  4. Run: build.bat
  5. After building, go to the dist/ folder – the compiled .exe will be inside.

About

A Python-based virtual personal trainer that uses motion recognition to count exercise reps, track workout history, and provide voice prompts. Users can create accounts, customize settings, and build personalized workout plans—all in an intuitive interface.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published