This is javascript based browser application with uses p5.js and ml5js to detect the posture and analyze. This could be used for ergonomic assessment.
This code can be downloaded locally and can run on any browser like safari or chrome.
Alternatively, you can launch this here.
Inputs : Webcam input
Outputs : Detects if posture is incorrect, alerts you with a buzz and provides ergonomic stats.
System takes webcam input, uses posenet model to determine eyes and nose. The co-ordinates of eyes, nose and triangular area formed with these is fed to a neural network to train and classify the posture.
The idea behind using triangle area is to comprehend depth (distance between plane formed with face and the camera).
- Once the page is opened, click on "start" button. At this point you should be able to see yourself with markers around eyes and nose.
- (Training) Press "SPACE BAR" everytime you are in a ergonomically correct posture, you can turn your head sideways etc. Collect atleast 10 samples for better training.
- (Training) Press "down arrow key" everytime you are in a ergonomically wrong posture, you can hunch or take any other wrong posture. Collect atleast 10 samples for better training.
- You can repeat step 2 & 3 any number of times you like, but make sure you don't take too many as this might slow down the training time.
- Press "t" key to start the training. At this point you might have to wait for 200 epochs to be completed.
- (Classification) That's it! Once, the training is complete, you will be notified with a sound, everytime you hunch. Also, a timer is displayed to indicate the time you are infront of the computer and the time you were in wrong posture.
- Shoulder points are not detected in the front view of the camera.
-
can you run p5.js with external webcam instead of inbuilt camera?
-
try this instead of posenet since it might be fast? https://learn.ml5js.org/#/reference/face-api