Human pose analysis in art-history: 2D pose analysis, clustering and visualization
The project contains three scripts:
- preprocessing.py: takes the .json file of a dataset exported from Supervisely and outputs a .txt file where each row contains the (x,y) coordinates for the 24 keypoints of each image, and a corresponding file with the angles of each pair of keypoints rotated according to the torso.
- clustering.py: clusters the datasets using k-means and creates 2D and 3D plots using PCA.
- tsne.py: clusters the datasets using k-means and creates 2D and 3D plots using tsne. Two cases are tested: The first one takes into account inly the keypoints of the human posture, whereas the second one uses both the keypoints ans the torso rotation angles.
- torso_clustering.py: clusters the datasets using only the torso rotation angles.
- Visualization.py: helper functions for visualization.
- image_resize.py: resizes an imput image.
To run the project you have to execute the following steps:
- Create the virtual environment humanpose:
python -m venv humanpose
- Activate the virtual environment:
humanpose\Scripts\activate.bat
source humanpose/bin/activate
- Install the dependencies:
pip install -r requirements.txt
- Run the scripts
python preprocessing.py
python clustering.py
python tsne.py
python torso_clustering.py