Machine Learning Projects with JavaScript

I’m very excited to have completed 3 fun Machine Learning projects. I will try to explain in this blog how this works and include the resources/links.

My first project is Speech Recognition, which repeats what the user says on a colorful canvas.

2nd fun project is Draw , which recognizes user’s command and draws on the canvas.

And Body Parts via PoseNet processes the image it sees via the camera and recognizes various body parts.

All the points the PoseNet model can identify. Source : https://github.com/tensorflow/tfjs-models/tree/master/posenet

These projects were done by p5js, which is a JavaScript library for creative coding.

You could immediately start coding by using p5js’s online editor. https://editor.p5js.org/

There are tons of fun examples on the website: https://p5js.org/examples/.

I incorporated ml5js libraries for the machine Learning portion of the code. ml5.js is machine learning for the web in your web browser. Through some clever and exciting advancements, the folks building TensorFlow.js figured out that it is possible to use the web browser’s built in graphics processing unit (GPU) to do calculations that would otherwise run very slowly using central processing unit (CPU).

PoseNet is a machine learning model that allows for Real-time Human Pose Estimation.

PoseNet can be used to estimate either a single pose or multiple poses, meaning there is a version of the algorithm that can detect only one person in an image/video and one version that can detect multiple persons in an image/video.

The original PoseNet model was ported to TensorFlow.js by Dan Oved. For background, read Real-time Human Pose Estimation in the Browser with TensorFlow.js.

p5js library can be found on github here: https://github.com/processing/p5.js

ml5js library can be found on github here: https://github.com/ml5js

ml5js libraries currently support Chrome, so please use Chrome to review my sample projects above.

Also, check out Daniel Shiffman’s Coding Train youtube channel for very helpful and entertaining tutorials.

I hope you enjoy these 3 fun projects and hope they inspire you to learn more about these technologies.

Thank you! And Happy Valentine’s Day!

Ebru