>> Hi, everybody. It's me.
Ladyada, and I'm here at the Adafruit factory in
Downtown Manhattan where we
manufacture all of our electronic goodies,
from accessories for the Arduino or
Raspberry Pi boards to
our very own Feather and Circuit Playground Express.
We have huge community of makers and engineers as well,
with almost 30,000 Discord members,
1,500 GitHub repos, and weekly live shows,
almost every single day.
We have a lot of insight into what
makers and engineers are doing with our products,
and we're always so impressed with how creative they can be.
I'm going to show you a demo using
an Adafruit BrainCraft HAT for
Raspberry Pi and Microsoft Lobe.
The BrainCraft HAT fits on top of the Raspberry Pi 4,
and makes it really easy to connect
hardware and debug your machine learning projects.
There's a 240 by 240 color display
so you can see what the camera sees,
which is great for vision projects.
There's two microphones for audio input,
and then GPIO ports
so you can connect things like relays, servos,
LEDs, or other mechanical devices
that you want to control from your Raspberry Pi.
Microsoft Lobe is a free tool
that you can use to create and
train machine-learning models that you
can then deploy almost anywhere.
This takes care of the hardest part of machine learning,
which is creating and training a new model.
I've been playing with the idea of using a Raspberry Pi,
the BrainCraft HAT, and a Raspberry Pi camera
to recognize these delicious baked goods
for my local deli.
Now these baked goods don't have QR code or barcodes.
That's why using a camera with
vision recognition would be
an excellent way to identify and
price each individual baked good.
Let's show how easy it is to use
Microsoft Lobe to train a new machine learning model.
We're going to create a new project
called the lobe bakery.
Now it's time to import image data.
Click on import and select your webcam.
Now it's time to train the model
on different images of baked goods.
Let's start with the cinnamon roll.
Place the objects you want to train in front of
the camera and select
the label that you want for these images.
Now take about 20 images of your baked good.
You'll want different poses,
angles, maybe flip it upside down.
I've got about 20 images of the cinnamon roll.
I'm going to continue doing this for
each one of my baked goods.
After I verified that my model is correctly
identifying all my delicious baked goods,
it's time to export that model.
Go to the "Export" tab and you can see all the options.
You can create a web app,
you can export it to TensorFlow, to JavaScript,
you can even make your very own REST Server,
web app, or run it on
a mobile phone using iOS or Android.
In our case, we want to export it to
a TensorFlow Lite model file
that will then copy over to our Raspberry Pi.
Let's start by SSHing into the Raspberry Pi,
then cd into the directory
where I've downloaded the software.
Now you can run the basic prediction project
that's written in Python.
Because I've already deployed the model,
it's going to immediately start doing predictions
based on what the Raspberry Pi camera sees.
To start, it sees nothing.
But when I put a cinnamon roll in front,
the text will update, telling me
the confidence and the label of the object detected.
I can also try a cross bun or a bagel.
Now because we've deployed
our machine learning model onto a Raspberry Pi,
it means it's really easy for us to connect
all sorts of other cool hardware.
I've got in addition to the display: three LEDs,
that are going to glow green when something is detected;
I've got a speaker and
some text-to-speech code that's going
to speak out what's detected;
and I even got a receipt printer hooked up
that will print out the product and the price.
Let's try it with the cross bun.
>> Cross bun.
>> Or of my favorite, the cinnamon roll.
>> Cinnamon roll.
>> Or the bagel.
>> Bagel.
>> There you go. Thanks, Lobe.
We sell the BrainCraft HAT and machine
learning kit for Lobe at the Adafruit shop,
and we've got tons of tutorials to
get you started on your machine learning journey.
Now that you've seen how easy it is,
I can't wait to see what kind of
creative projects you come up with.
Thank you to Microsoft and Lobe for making
machine learning training so easy.