GithubHelp home page GithubHelp logo

radroof22 / ptai Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 1.17 MB

Physical Therapy assistant using machine learning that tracks user's workouts and helps them complete them remotely

JavaScript 61.58% HTML 38.42%
vision pose-estimation posenet physical-therapy

ptai's Introduction

PtAi

The inspiration for this project came out of the recent rise in tele-medicine and doctors appointments hosted over the internet. As such, I wanted to see if there was a way to bring physical therapy to the online world to help people at home get the most out of their workouts. Current products already exist that allow users to track their joint movements as they do a series as exercises, though these solutions are often expensive. Instead, a machine learning technique would allow the users to just need their phone to complete their assigned workouts and gain assistance from the model.

Awards

  • 1st Place at Montgomery County Science Fair for Computer Science in 12th grade division
  • 3rd Place at Delaware Valley Science Fair for Computer Science in 12th grade division

Image of Bicep Curls using Pt.Ai

How to Run

npm install

npm run develop

Goals

  • Create website hosting pose estimation model
  • Take camera input from the user's browser
  • Feed camera input into ml5 pose estimation model
  • Approximate freedom of motion / angle of joint using pose estimated points and the law of cosines
  • Display live readings of the angle of motion for the user
  • Count the number of reps the user completes

Camera Feed

  • The camera feed was obtained using p5.js
  • Camera feed was then passed to PoseNet model wrapper from ml5
  • Take joint values and return to angle calculator

Angle Calculator

  • Use Euclidian Distance formula to find distance between two points on the 2d grid as approximated by PoseNet
  • Use distances as input to law of cosines, which will output angle of that triangle formed by the three lines

Rep Counter

  • Through trial and error (as well as research on freedom of motion for joints) create breakpoints for the angle of the joint as approximated by PoseNet
  • Create visual counter using p5 to count the number of reps

Note: Side of the Body

  • When switching arms, use "left" joints instead of "right" and likewise vice versa
  • When deciding on both arms, make sure both body parts achieve the desired degree of motion

Available Workouts

  • Bicep Curls
  • Shoulder Flexion
  • Forward Bend

ptai's People

Contributors

radroof22 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

juchiman

ptai's Issues

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.