2021-06-26 · 2 min read
Machine learning used to mean wrangling Python, datasets, and training scripts long before you saw any result. Teachable Machine, a free tool Google released on November 7, 2019 (teachablemachine.withgoogle.com), flips that around: it lets anyone train a working ML model entirely in the browser, no machine learning background required.
The tool offers three project types — Image Project for classifying pictures, Audio Project for recognizing sounds, and Pose Project for detecting body positions. All three run on TensorFlow.js right in the browser tab, so there's no environment to install or configure.
Image Project is the easiest starting point, and the workflow boils down to three steps:
A TensorFlow.js export gives you three files — model.json, metadata.json, and weights.bin — which you load in plain JavaScript to run real-time predictions against a webcam feed:
const model = await tmImage.load('model.json', 'metadata.json');
Each class comes back with its own probability score, so picking the highest one gives you the final classification.
What stands out about Teachable Machine is how short the distance is between poking around in a browser tab and having a model wired into a real application. If you haven't tried it yet, the official site is worth ten minutes of your time — it's simpler than it sounds.