/Squat-Analysis-CVproj

Official code for the iSTAR 2023 paper "A Case Study for the Automatic Supervision of Body-Weight Exercises: The Squat"

Primary LanguagePythonMIT LicenseMIT

A Case Study for the Automatic Supervision of Body-Weight Exercises: The Squat

Official code for the iSTAR 2023 paper "A Case Study for the Automatic Supervision of Body-Weight Exercises: The Squat". This repository contains the official python implementation of the experiments described in the paper.

outputZED outputMOCAP

MOCAP Skeletons in deep squat positions aligned with Procrustes transformation: correct squat (blue) and bad squat (red)

Install libraries

The code is originally developed in Python 3.7.

pip install matplotlib numpy scipy

Load data

You can find the data we used for our experiments here: https://drive.google.com/drive/folders/1hWCvyQGq6Cp3Z7RWAld1Zkm9-VVjjvpe?usp=share_link After downlaoding them, move them into the folder body_data

Usage

Experiments for the ZED system

In order to compute the experiments for the ZED system as shown in the paper, move in the directory src/ZED Then, run:

python ZED_comparison.py reference sample

To generate a 3D plot of a time-instant (e.g.1200) of the reference/sample movement, run:

python ZED_3Dplot.py <file_name> <time_instant>
ZED_3d

To generate a 2D plot of the head and pelvis trajectories of the reference/sample movement, run:

python trajectories.py

The script analyzes the trajectory of the head relative to a vertical reference line and the trajectory of the pelvis for a given sample compares it with the reference movement.

ZED_head_trajectory_sample3
Trajectory of the head relative to a vertical reference line - Sample 3

[ZED_pelvis_trajectory_refVSsample4
Trajectory of the pelvis vs the reference trajectory of the pelvis - Sample 4


Experiments for the MOCAP system

In order to compute the experiments for the MOCAP system as shown in the paper, move in the directory src/MOCAP Then, run:

python MOCAP_comparison.py reference sample

To generate a 3D plot of a time-instant (e.g.4200) of the reference/sample movement, run:

python MOCAP_3Dplot.py <file_name> <time_instant>
MOCAP_3d

To generate a 2D plot of the head and pelvis trajectories of the reference/sample movement, run:

python trajectories.py

The script analyzes the trajectory of the head relative to a vertical reference line and the trajectory of the pelvis for a given sample compares it with the reference movement.

MOCAP_head_trajectory_sample3
Trajectory of the head relative to a vertical reference line - Sample 3

[MOCAP_pelvis_trajectory_refVSsample4
Trajectory of the pelvis vs the reference trajectory of the pelvis - Sample 4

Citation

Please cite the following paper if you use this code directly or indirectly in your research/projects:

@inproceedings{SquatAnalysis:iSTAR:2023,
  title = {A Case Study for the Automatic Supervision of Body-Weight Exercises: The Squat},
  author = {Aliprandi, Girardi, Martinelli, De Natale, Bisagno and Conci},
  conference = {International Workshop on Sport Technology and Research (IEEE-STAR)},
  month = jun,
  year = {2023},
  month_numeric = {06}}

License

Software Copyright License for non-commercial scientific research purposes. Please read carefully the terms and conditions and any accompanying documentation before you download and/or use the provided data and software, (the "Data & Software"), software, scripts, and animations. By downloading and/or using the Data & Software (including downloading, cloning, installing, and any other use of this repository), you acknowledge that you have read these terms and conditions, understand them, and agree to be bound by them. If you do not agree with these terms and conditions, you must not download and/or use the Data & Software. Any infringement of the terms of this agreement will automatically terminate your rights under this License.

Contact

The code in this repository is developed by Paolo Aliprandi and Letizia Girardi while at University of Trento.

If you have any questions you can contact us at mmlab-disi@unitn.it.

For commercial licensing, contact mmlab-disi@unitn.it