Giter Club home page Giter Club logo

posture-detection's Introduction

backend API for hunchback-detection

A lightweight posture classifier using frontal camera images. Provide API for frontend using client-server method with framework Flask of Python.

Dependencies

API usage

Run 'api.py', after the Flask finished preparation, frontend framework can call api through socket with port 5000. The API receives a list of detected keypoints and returns the prediction according to them.

Data Collection

Run datacollect.py. Then switch to an 'okay' posture while pressing the key B. Then switch to an 'bad' posture while pressing the key C. Then switch to an 'terrible' posture while pressing the key D. Data instance count will be shown on the terminal. 400 instances for each category works well for me. After collecting, press Q to exit the program and a posture_data.npy file will be saved.

Model Training

Run trainclassifer.py to train the model, a simple scikit-learn LogisticRegression classifier. The model will be saved as model.sav

In addition, train the model through this Colab Notebook for better accuracy: ML Pipeline

Demo

To see how well your model is, run predict_demo.py. The classified posture will be shown as text on screen.

Further Usage

Run predict_nofity.py to use the actual posture remainder program. The classifier will run in the background and pop up a Windows notification in the lower right corner whenever you are in a bad sitting posture.

posture-detection's People

Contributors

nguyentran186 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.