Google has made it ridiculously easy to train machine learning models right in your web browser! Let's see what https://wlhc-teachablemachine-demo.glitch.me does.
To get started, visit https://techablemachine.withgoogle.com and click on "Get Started". Teachable Machine currently offers 3 different models: image, sound, and pose.
Let's say you want to make a machine learning app that distinguishes between you alone and you with your phone.
- Click on "Image Project". Rename "Class 1" and "Class 2" to "Me" and "Me with phone", respectively.
- Click on the "Webcam" button and record yourself with your phone on the first model and without your phone on the second model.
- There is no "correct" number of pictures to take, but generally, the more, the better. Shoot for somewhere in the 50-150 range.
- Click "Train model" and wait for it to do its magic.
- Play with your new model in the model preview! When you hold up your phone, you should see your second model's accuracy go to 100%.
- Add it to some code!!!! Hell yeah!!!! Click on "Export model". Here you'll see all of the code you need to make your model work in code. If you switch to the p5.js tab, you'll see all of the p5.js-specific code you need.
- To generate a unique link for your model, click on "upload my model". Once it's uploaded, your link will magically appear under "Your shareable link".
- Open up the code snippet directly in the p5.js web editor to see Teachable Machine in action
- The code is currently using a sample model by Teachable Machine that distinguishes between "day and night". You can play around with this if you want, but if you want to see the model you created, change the link on line 15 to the link to your model.
- Magic!
Next steps
Play around with this! Think of some fun ideas to do with either the video, audio, or pose models, and train them to do cool things! Change the code to complement the model (maybe change the background color based on which model is active?) and have fun with it!
Also, https://hack.af/make-dino