Coder Social home page Coder Social logo

liu-tianhang / dance-moves-determiner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ct15/dance-moves-determiner

0.0 0.0 0.0 11.87 MB

๐Ÿ’ƒ NUS CG3002 Embedded Systems Design Project (Software)

Home Page: https://tinyurl.com/CG3002FinalReportGroup5

Python 99.88% Shell 0.12%

dance-moves-determiner's Introduction

dance-moves-prediction

We aim to predict dance moves using a combination of Random Forest and Support Vector Machine (SVM) to get the best possible accuracy. Train and test data are based on the readings obtained from two sensors (GY-521 MPU6050 3-Axis Acceleration Gyroscope 6DOF Module) attached to the dancers wrists. The raw features are Acceleration x, y, z and Rotation x, y, z. There are a total of 11 dance moves to be classified.

Resolving Dependencies

  1. Create a virtual environment in the directory
python3 -m venv venv
  1. Activate the virtual environment
source venv/bin/activate
  1. Install all the required dependencies
pip install -r requirements.txt

Generating Machine Learning Models

  1. Activate the virtual environment
  2. Resolve all the dependencies
  3. Run python train_random_forest.py to generate Random Forest model
  4. Find the models in .sav format in models directory
  5. Find the training statistics and evaluation results in eval_results directory

To generate SVM model, run python train_svm.py at Step 3 instead.

Alternatively, run ./fast_generate_models.sh at Step 3 to generate both models at the same time.

See sample evaluation results here

Note that if you run this without GPU, each Machine Learning model takes around 1.5 hours to generate owing to the hyperparameter tuning involved. As such, you may want to train the models from a detached session of a terminal multiplexer.

Plotting Graphs for All Dance Moves

  1. Activate the virtual environment
  2. Resolve all the dependencies
  3. Make sure that the code below is commented out in train_data.py ๐Ÿ‘Ž
  ##### COMMENT OUT THE CODE BELOW BEFORE RUNNING plot.py #####
  df_max_min = prep.flatten(df, interval)
  df_var = prep.flatten(df, 'var', interval)
  df_concat = prep.concat_df(df_max_min, df_var)
  df = prep.append_truth(df_concat, number)
  #############################################################
  1. Run python plot.py
  2. Find the graphs in .png format in plots directory

For some reason, adding an additional parameter in the dode to skip Step 3 makes the code runs 99999x slower. ๐Ÿ˜“

See sample plots here

Testing Final Model

  1. Activate the virtual environment
  2. Resolve all the dependencies
  3. Generate machine learning models
  4. Customise how the models generated are utilised in MLModel class (test_model/__init__.py file)
  5. Run python test.py

Note that final model can be a combination of both Random Forest and SVM.

dance-moves-determiner's People

Contributors

ct15 avatar stan789 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.