Dead simple example of integration between the image recongition software Lobe and Microbit.
It's a webpage that loads a model produced by Lobe and sends recognised labels to a serial interface, which can be plugged to a Microbit or any other device (even an Arduino).
Why not?
The idea is to test possible applications of Machine Learning with embedded devices, such as Microbit and Arduino.
- Train a model with Lobe.
- Export your model as a Tensorflow.JS example.
- Copy the content of the folder that you have just exported into the
model
folder. - Serve the webpage with a local web server, such as the Live sever for VSCode or any other really.
- Prepare code for Microbit (or other board) so that it can parse text from the serial line with a format like the following:
label,confidence\n
(each "event" is sent as a separate line). If you work with Microbit, you can use this example code which shows a different icon (🍌 or 🍎) depending on the label it receives ("banana" or "apple"). Change it according to your labels and idea. - Open the webpage in Chrome, give it access to your camera, connect it to Microbit and have fun.
- You can change the rate at which events are sent to Microbit and put a threshold under which labels are not sent.
Developed by Dario Salvi, with the help of Jens Pedersen, for the Master in Interaction Design of Malmo University.