Sporty is an AI model designed to assist during workout sessions by monitoring repetitions and movements using the Mediapipe library.
Ensure you have Python 3.10.6 installed before proceeding.
-
Create a virtual environment using Python 3 (follow the installation instructions at virtualenvwrapper documentation):
virtualenv <name_env>
-
Activate the virtual environment:
source <name_env>/bin/activate
-
Install Python requirements:
pip install -r requirements.txt
Important: The latest PyAV versions are incompatible with the pytorch version used. Info: pytorch/vision#7305
Sporty utilizes the Workout Video dataset from Kaggle, which consists of 22 different categories of workouts.
Sporty offers two modes: with or without exercise prediction.
Run the main script:
python main.py
In this mode, it's not necessary to have the model pre-trained beforehand. Currently active exercises include:
- Pull Up
- Squat
To use this mode, where Sporty predicts exercises, it's necessary to train the model first. Follow these steps:
- Preprocess Videos: Run
preprocess_videos.py
. - Split Data: Run
split_data.py
. - Train Model: Run
train.py
.
- Incorporate correction mechanisms for new exercises.
- Ensure predicted exercise names match the defined exercises.
Feel free to contribute and enhance Sporty's capabilities!