/pose-classification-train-svm

Classify Poses with Pose Estimation and Support Vector Machines (SVM)

Primary LanguageJupyter NotebookApache License 2.0Apache-2.0

Classify Poses with Pose Estimation and Support Vector Machines (SVM)

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.

High-Level Workflow

  1. Gather image dataset
  2. Perform pose estimation and save keypoints
  3. Load data
  4. Clean and normalize data to be used as input to SVM
  5. Choose a classifier
  6. Train Classifier
  7. Test Classifier

Gather Image Dataset

I used the Yoga-82 image dataset. It isn't included in this repo, you must request access independently.

Perform Pose Estimation

This is done using the alwaysAI app found in pose-recorder.

Setup

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.

Usage

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.

Cleaning Data and Training SVM

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!