This repo contains an alwaysAI app and Jupyter Notebook to classify poses using Pose Estimation from alwaysAI and machine learning tools from Scikit-Learn. This tutorial will walk through training an SVM to classify a few common yoga poses.
There are two parts to this repo: pose-recorder and train-svm, described in the sections below.
- Gather image dataset
- Perform pose estimation and save keypoints
- Load data
- Clean and normalize data to be used as input to SVM
- Choose a classifier
- Train Classifier
- Test Classifier
I used the Yoga-82 image dataset. It isn't included in this repo, you must request access independently.
This is done using the alwaysAI app found in pose-recorder.
This app requires an alwaysAI account. Head to the Sign up page if you don't have an account yet. Follow the instructions to install the alwaysAI tools on your development machine.
Once the alwaysAI tools are installed on your development machine (or edge device if developing directly on it) you can run the following CLI commands:
To set up the target device & install path
aai app configure
To install the app to your target
aai app install
To start the app
aai app start
It will output CSV files with the collected pose data.
The following sections can be found in the Jupyter Notebook in train-svm.
Copy the CSV files generated by the pose recorder to a directory called in
inside the train-svm directory before starting, and follow the steps in
the notebook to clean and normalize the data, train an SVM, and test it out!