MENU

Fun & Interesting

Want To Learn Some AI With JavaScript? Let's Do Facial Recognition!

Good Morning Developers 7,425 10 months ago
Video Not Working? Fix It Now

Feeling left out of the AI/Machine Learning frenzy because you are a web developer? In just 30 minutes, go from some simple starter code to doing AI, with JavaScript, in the browser! We use face-api.js to detect faces in a live video feed, and then we can draw the points, a box around the face, check age, gender, and expression, and then try and match the face(s) to another face. With a few changes, you can do facial tracking, or advanced recognition! This isn't building AI models, it is implementing a library and is a great way to get some exposure to machine learning before moving on to TensorFlow and the more intense work. FaceAPI video (images only) - https://youtu.be/cGFKc-XRYKQ WebRTC Video - https://youtu.be/g42yNO_dxWQ Code Links: Starter code - https://github.com/robertbunch/face-api-js-starter Final Code - https://github.com/robertbunch/face-api-webcam face-api.js - https://github.com/justadudewhohacks/face-api.js Tensorflow - we don't use it, but here it is -https://github.com/tensorflow/tfjs 0:00 - Introduction 0:22 - FaceAPI & Starter Code 5:14 - Video stream 8:22 - Setting up https (if stream fails) 12:33 - Load models & set canvas 16:02 - Facial Detection (finally!) 23:01 - Expressions and age/gender 27:13 - Facial Recognition

Comment