This repository contains the code and resources for the project that explores the use of Google's MediaPipe and OpenCV to detect skeleton keypoints in action videos, generating a skeleton image representation (Skelemotion [1]). The generated Skelemotion data is then utilized to train an autoencoder model for learning the movement patterns by minimizing the reconstruction error. Ultimately, the project is designed to detect anomalies in each repetition of the deadlift exercise.
The goal of this project is to create a robust anomaly detection system for deadlift exercises using a combination of computer vision techniques and deep learning. By capturing and analyzing the skeletal movement patterns, we aim to automatically identify anomalies in the execution of the exercise, which can be useful for fitness tracking, injury prevention, and form correction.
- Utilizes Google's MediaPipe for skeleton keypoint detection.
- Generates Skelemotion images for representing skeletal movements.
- Trains an autoencoder model to learn and reconstruct the movements.
- Implements anomaly detection algorithms to identify deviations from the learned patterns.
- Provides a clear visualization of anomalies in action videos.
To get started with the project, follow these steps:
-
Clone this repository to your local machine:
git clone https://github.com/yourusername/deadlift-anomaly-detection.git
-
Install the required dependencies:
pip install -r requirements.txt
-
Download or prepare your action video dataset (refer to the Data section for details).
-
Follow the instructions in the Usage section to run the code and start the anomaly detection process.
- Navigate to the predict/predict.py directory.
- Use your file explorer or terminal to go to the directory where predict.py is located.
- Open a terminal within this directory.
- You can open a terminal or command prompt in this directory by right-clicking and selecting "Open Terminal" (or "Open Command Prompt" on Windows).
- Activate the virtual environment where the necessary packages are installed.
- If you're using a virtual environment (e.g., conda or venv), activate it using the appropriate command.
- Execute the prediction script.
- Run the following command in the terminal:
python predict.py --video <path_to_deadlift_video>
Replace <path_to_deadlift_video>
with the actual file path to your Deadlift video.
5. Wait for the result window to open.
- The prediction process may take some time depending on the video's length and complexity. Please be patient.
- Access your video results.
- Once the prediction is complete, the video results will be automatically saved in the same directory as your input video file.
The following pipeline was followed to create the dataset for training:

Refer to the report document for a detailed explanation of each stage.
The skeleton representation image is fed to an autoencoder to reconstruct the dataset over 500 epochs.
