Tinkering With Tensorflow.js and PoseNet

September 21, 2019

I wanted to try out tensorflow.js so I built a web app that counts how many squats you do.

I started from this image classifier example and then got most of the code from this ml5 demo.

The web app uses PoseNet to get the coordinates of the joints (elbows, knees…) and then a KNN classifier to classify these points. I recorded 4 examples for the KNN to use. Two standing up and two squatting.

The web app then increments the counter when it detects a pose change from squatting to standing up.

Next, I’d like to understand the KNN algorithm a bit more, try different camera resolutions, add more poses, and do the same in a flutter app using ML Kit.