Giter Club home page Giter Club logo

hunchback-detection's Introduction

hunchback-detection 驼背检测

A lightweight sitting posture classifier using frontal camera images. You can optionally send a Windows notification to remind you. This is what I used personally to help correct my sitting posture. The training data describes my own behavior, you may need to collect your own data and train your own model (takes about 2 minutes).

Dependencies

opencv-python
mediapipe
scikit-learn
win10toast (for poping Windows notification)

Data Collection

Run datacollect.py, after seeing your images, maintaining an 'excellent' posture while pressing the key A. 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 ESC 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

Demo

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

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

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.