Machine Vision with HuskyLens

Rek XIX
40 followers
4 Video Views·Oct 31, 2022
Machine Vision with HuskyLens
Today in the workshop we are working with the Husky Lens, an inexpensive AI powered machine vision sensor.
We'll see how we can use all of the features of this amazing device, both by itself and with an Arduino.
It's an AI opener of an episode today, so welcome to the workshop.
Well hello and welcome to the workshop where we've been working on the edge lately, and what I mean by that is edge computing devices.
Now edge computing devices are IoT or sensor devices that have intelligence themselves, so they can not only collect data,
they also pre-process the data for you, and that alleviates a lot of the tasks off of the host microcontroller or host microcomputer.
Now a good example of that was the ultrasonic sensors that we worked with recently.
They not only collect the data, they actually process it and give you back a reading of how many millimeters you are distant from the object that you're trying to measure.
And so this is a good example of pre-processing in edge computing.
Well another bunch of edge computing devices that I've been working with lately have to do with video recognition,
and I've got a few from a number of different manufacturers.
Now all of these devices have a few things in common.
All of them obviously have video cameras, they wouldn't work without video cameras.
They also have small display screens so that you can work with these devices without having to attach an external screen or computer to them.
And one thing they have in common as well is that they're all based upon an incredible microcontroller, something called the Kendrite K210.
Now calling the K210 a microcontroller almost seems kind of weird considering the specs it has.
This is a dual core 64-bit unit, it has an integrated floating point unit as well,
and together they form something that Kendrite calls a KPU, which is useful for neural network development.
Now these devices are specifically targeted for both video recognition and for audio recognition.
They have inputs for up to eight different array microphones,
and we're going to be using them in their video application today with a device from DFRobot called the Husky Lens.
And so let's go and take a look at the Husky Lens now and see what it can do.
The Husky Lens is an artificial intelligence machine vision sensor.
It's available in two models, the regular Husky Lens with a 2 megapixel camera, or the Husky Lens Pro which has a 5 megapixel camera.
Both models feature a 2-inch IPS display.
The Husky Lens operates on either 3.3 or 5 volts, making it suitable for virtually any microcontroller or microcomputer.
The interface on the Husky Lens can be operated as either a serial UART or in I2C mode.
The Husky Lens can be used in standalone mode for training purposes without connection to a microcomputer or microcontroller.
The device also has a microSD card that can be used to save training models or images from the camera.
Let's take a look at the Husky Lens.
In the center of the Husky Lens we can see the camera.
This is either the 2 or 5 megapixel device, depending upon which model you've purchased.
Above the camera we see an RGB LED.
This is used to indicate status during training mode, and is useful when you are using it in selfie mode,
in other words trying to do face recognition on your own face where you can't see the screen on the back.
The selector wheel is used to navigate through the menus on the Husky Lens.
It can be moved to the left or the right, and can be pushed down to make a selection.
The training button is depressed when you want to train the Husky Mode to learn an object.
There are two white LEDs on the Husky Lens.
These can be used in line tracking mode to illuminate the subject for better performance.
Below one of the white LEDs you can see the microSD card slot.
The microUSB connection on the Husky Lens is used to supply power.
The 4 pin data connector is a JST connector that's used for both data and power.
You can have power on this as well as the microUSB connector.
If you've powered them both then the microUSB will be used to power the device.
The 2 inch screen on the Husky Lens measures 240 by 320, and is divided into the following coordinates.
These are the coordinates used by the Husky Lens when doing object tracking or line tracking.
In face recognition mode the Husky Lens detects face contours.
You can save the detected faces, and you can track those faces as well.
The Husky Lens is capable of working with single or multiple faces.
With object tracking the Husky Lens can learn and track a specified object.
Only one object can be tracked, and multiple objects are not supported.
In this mode the Husky Lens also supports the detection of gestures.
In object recognition mode the Husky Lens can recognize some predefined objects.
The device has 20 different objects predefined.
You cannot however add any new objects.
It also can't distinguish between objects of the same type.
For example two pictures of different cats will be recognized as a cat.
In line tracking mode the Husky Lens can track a specified colored line.
It's capable of working with single or multiple lines.
It's also capable of making predictions as to which direction the line will continue.
In this mode the white LEDs can be used to illuminate the lines for better performance.
In color recognition mode the Husky Lens learns and recognizes specific colors.
This can be used to track colored objects.
The accuracy of color recognition mode can be greatly affected by the ambient lighting.
The device also has problems with two objects with similar colors.
In tag recognition mode the Husky Lens can detect, learn, and recognize tags.
The device supports AprilTags, a tagging mechanism developed at the University of Michigan.
Both single and multiple tags are supported.
In object classification mode the Husky Lens can be trained to recognize different objects.
Multiple objects are supported, for example apples, oranges, pears, and bananas.
Unlike object recognition mode, however, the Husky Lens does not report the object's position,
and will only report one object at a time.
The data connector on the Husky Lens is a 4-pin JST connector,
which is used in both Serial UART and I2C mode.
This chart shows the pinouts of the connector in both of those modes.
So now let's take a closer look at the Husky Lens.
Now here's what you get when you purchase the Husky Lens,
and it actually comes in two separate boxes.
This box contains the Husky Lens itself, the cable, and the mounting brackets that you get over here.
And this box contains a little silicone holder that you can use to put on your Husky Lens to cover it up,
and it's got a hole for the camera in it.
Plus it also has two little ears on it,
so it actually does look a little like a husky.
Now the main component of the course is the Husky Lens itself,
and this is the Husky Lens. You can see the camera on it over here.
Here is a push button, and here is a rotary dial that you use as a function thing
to navigate through the menus and select things.
Over here we have a microSD card slot,
and the microSD inserts from the inside over here if you're going to be using it.
This is actually the Kendrite K210 processor over here by the way,
and down in the bottom we'll find a couple of connectors.
This connector here is a microUSB, and it is used just for power,
and this one over here is a 4-pin JST connector,
and it's used for power as well as data,
and it supports both UART serial data and I2C data using the same connector.
Now they give you this cable that will plug into there,
and this cable is terminated with a couple of DuPont female connectors over here,
and so you can use that to connect the Husky Lens to your microcontroller or microcomputer.
Now when we flip this over, what we'll see on this side is a screen,
and this is a color screen. It's a 2-inch screen that displays everything the Husky Lens is seeing,
and also the menus so that you can work with it.
Now when you first get it, you can power it up right away,
so I've got a USB cable over here. I'll connect it to my Husky Lens,
and as you see it boots up, and it comes up right away and starts working,
and you use this dial over here to go through the different modes that you can get in,
and when you get to a mode that you want to be in,
you just press the dial, the thing down over here,
and now it's going to be in that particular mode,
and you can use the button on this side for training it,
and I'll show you that in more detail in a few moments.
Before using the Husky Lens, you'll want to check the current firmware version,
as chances are that you'll need to update it.
Use the dial and move to the general settings,
and then press down to select the lower menu.
Use the dial again to move all the way over to version,
and check your version number.
Now mine's 0.5.1a, which is a recent version,
but if yours is earlier than that, you'll need to do a firmware update.
Although you can do this update under any operating system,
it is much easier to do it using Microsoft Windows.
To start, you'll need to download a universal Windows driver from Silicon Labs.
The link for that is in the article accompanying this video.
You'll also need to go to the Husky Lens GitHub page,
and download two different things.
First of all, the Husky Lens Uploader for Microsoft Windows,
and secondly, you'll also need to download the latest version of the HuskyWare firmware.
After that, you can install the universal Windows driver that you downloaded earlier.
It's a simple Windows installation program.
And then you'll want to connect the Husky Lens up to your computer
using the micro USB cable,
and look in your device manager to make certain it is seen.
Look for a Silicon Labs device.
The next step is to run the uploader itself.
In the select file box, you're going to want to select
the new version of the firmware that you downloaded,
and then just click the upload button.
It will cycle several times between 0 and 100%,
and the whole procedure takes about 5 minutes.
But once you're finished, the firmware should be updated,
and you're ready to use your Husky Lens.
So now that we understand how the Husky Lens works,
it's time to actually start using it.
So what we're going to do next,
is go through all the different modes of operation
that the Husky Lens is capable of performing.
Now you'll have to have updated your Husky Lens
to the latest version of the firmware,
in order to follow along,
because some of the modes of operation
were only available with the latest versions of firmware.
So make sure you go ahead and do that.
Otherwise, all you're going to need to do
is to power up your Husky Lens with the USB cable.
It doesn't necessarily have to be connected to a computer,
it can just be a USB power supply.
So let's work through all of the different modes of operation,
starting with face detection.
The default in face recognition mode
is to recognize a single face,
and it's quite easy to do.
Just dial face recognition from the top dial,
focus on the face, and press the learning button.
If you hold down the learning button
while the face is moving, you'll get better results,
as it can learn all the different contours of the face.
Now this face has been recognized,
and other faces will just come up as face.
However, in default mode,
you can only recognize one face,
and you have no option to recognize other ones.
To do that, you'll need to put it into multiple face mode.
First, you'll need to delete the face you've already learned,
so get it back into screen,
click the learning button once,
and then click again to forget the face.
Now you're ready to set it up for multiple faces.
In face recognition mode,
click from the dial,
and navigate to learn multiple on the bottom screen.
You'll note that there's a toggle switch
that you can toggle now using the dial.
Toggle it into learn multiple mode,
and press it down to save the value.
Then go to save and return,
and press down again to confirm you wish to save this.
Now you can learn multiple faces.
Point at the first face you wish to learn,
and learn it in the standard fashion.
After you've done that,
click the button again to indicate
that you wish to learn more faces.
Point at another face,
and once again you can learn it in the standard fashion.
If you're finished, you can just leave it alone,
or do a quick press on the dial button.
And now the unit is capable of displaying
and learning both of the faces.
In object tracking mode,
the Husky lens can be set to learn
and track a single object.
You'll need to dial object tracking on the top screen,
then press the dial down,
and navigate to learn enable.
Set the toggle switch as we did with the previous example.
You'll also want to go to auto save,
and do the same thing with its toggle switch.
After that, you'll navigate to save and return,
and press the dial down to confirm that.
Now we can begin to learn and track our object.
Place the object in the focus area,
and hold down the learning key.
Continue to hold the key down
while you look at different angles of the object.
This will give you the best results.
Once you let go of the key,
it will still be learning the object,
even though it is already in its memory.
This way it continues to improve its performance.
Note that right now we are tracking our learned object,
whereas the second object, which is quite similar,
is being ignored.
In object recognition mode,
the Husky lens has been pre-programmed
to track from 20 different objects.
Getting into object recognition is quite simple.
Just dial object recognition at the top.
There are no additional setup steps.
After that, just aim the camera at the object
that you wish to track.
Note that the Husky lens will not distinguish
between two objects of the same type.
So one person, or two people,
will each just be tracked as a separate person.
It is, however, very good at tracking people,
and despite movements and things,
it does a pretty fair job
of keeping them in track.
I tried the Husky lens
with a number of different objects
it is capable of tracking,
and got reasonable results,
although I found with animals
it was often confused,
often confusing a cow for a horse,
and a sheep for a horse or a dog.
It did a pretty good job
on this video of a horse,
but on some of my other horse videos
it couldn't distinguish them from dogs.
So it really does depend upon
the source material that you are tracking.
This was particularly problematic,
often being confused for persons,
dogs, or even bottles.
It didn't have very much trouble
with a cat, at least this cat.
With some cats it was confusing them
with dogs, but otherwise
it did a pretty good job on that,
so your friendly feline
can be easily tracked.
A fast moving train did a pretty good job,
occasionally confusing it for a bus,
but admittedly this style of train
is a bit unique.
All in all, the performance here
was pretty good.
I was particularly impressed
on how it did persons
and motorbikes over here.
Now this is actually a bicycle
built for two,
and so it would go between
bicycle and motorbike,
and that's understandable.
It's not a very standard type of bicycle.
But what really impressed me
were these scenes of Amsterdam
with a number of bicycles,
cars, and people.
It did a great job of tracking them
and for a technician,
this device does a pretty good job
right out of the box.
The Husky lens is capable
of tracking single or multiple lines.
You'll get better performance
with single lines, however.
Dial line tracking, press down,
and then navigate to learn multiple.
You can turn it on or off
as you wish.
Also might want to turn on
the white LEDs using the LED switch.
This will give you improved performance
when tracking lines.
Now navigate to the target line.
Press the learning key
and the arrow will turn yellow
as it learns the line's parameters.
When you let go,
the arrow will be blue
indicating that it is tracking the line.
You will notice that the Husky lens
is capable of tracking vertical lines
quite well, but it doesn't seem
to work very well with horizontal lines.
If you're building a project
like a line tracking robot, however,
this is actually what you would want.
You would want to track a vertical line
and be interested in the horizontal ones.
In this respect,
the Husky lens performs quite well
in line tracking mode.
In color recognition mode,
the Husky lens is capable
of distinguishing between
one or many colors.
Dial color recognition at the top
and press down for the lower menu.
Navigate to learn multiple
and use the toggle switch for that.
Go to save data
and save your settings.
Now focus on the first color
and hold down the learning switch.
Press it again to learn a second color.
Move over to that color
and repeat the process.
You can continue to do this
for as many colors as you wish.
In my case, I'm going to do
the four colors you see on the screen.
Once you have done the last color,
you could even leave it alone
or press down the dial button
to complete the process.
Now the Husky lens can identify
the four different colors.
Note that the ambient lighting
can really affect
the performance of this.
But I thought it did a reasonable job
of picking up most of the colors
on this screen.
In tag recognition mode,
the Husky lens has been programmed
to recognize different April tags.
Only April tags can be recognized.
Dial tag recognition at the top,
press down on the dial
and then navigate to learn multiple
to learn multiple tags.
Use the toggle switch with the dial
and then return and press down
to save your settings.
Now give the Husky lens
a number of tags that you wish to learn.
Focus on the first tag
and press down the learning
and then press it down again
if you want to continue
onto another tag.
Note that you don't need
to press the button down
very long to learn a tag
as it's a simple two-dimensional object.
Continue to learn as many
different tags as you wish.
When you're finished learning the tags,
you can just ignore it
or press down on the dial button
to complete the process.
And now the Husky lens
has memorized the four different tags
that I've learned.
Note that the tags are recognized
even when turned to different angles.
Object classification mode
allows the Husky lens
to learn a number of different objects.
Enter object classification on the top,
press down on the dial
and navigate to learn multiple.
Click on that and then save and return.
Once you have set it up,
you can take your first object
and place it in the crosshair area.
Press the learning button
as you learn the object
from a number of different angles.
The more angles that you can learn
your object at,
the better the performance will be.
Here I'm learning a Raspberry Pi board
from a number of different angles.
Once you've learned all the angles,
release the button.
Click again to learn a second object.
And repeat the process
as I'm doing with this Arduino Uno board.
Once again,
you're going to try to learn your object
at as many possible angles as you can
for increased performance.
I found the quirk with the Husky lens,
however,
in that it will always display
the last object recognized
when there is nothing on the screen.
In order to get around that,
I just learn a blank object
over here.
Once you're finished,
you can click the other button
in order to save everything.
Now the Husky lens will have learned the object,
so as I place the Arduino in front of it,
it will display that object ID number 2
is being seen.
As you'll note,
with nothing,
object ID 3 was seen.
Here it correctly recognizes
the Raspberry Pi board
as object ID 1.
So now that we've seen the Husky lens
and the Arduino Uno board,
it's time to hook it up
to a microcontroller.
For this we're going to use
just a simple Arduino Uno.
If you recall from the beginning,
there are two different methods
of hooking up a Husky lens.
You can use the UART method
or you could use I2C.
We are going to try both methods.
We're going to run some
very simple demonstrations.
These demonstrations are included
with the Husky lens library
in a different fashion
than what you might be used to
with Arduino libraries,
but it's not that difficult
and I'll walk you through the whole thing.
So let's start off with our Husky lens
in UART mode.
For our first experiment,
we'll require an Arduino Uno
and the Husky lens.
We'll begin by connecting the transmit
or green lead from the Husky lens
to Arduino pin 10.
The receive or blue lead
from the Husky lens
to the Arduino Uno.
The Husky lens ground,
which is the black lead,
will be connected to the ground lead
on the Arduino Uno.
And finally the VCC,
which is the red lead,
will be connected to the Arduino's
5 volt output.
And this completes our wiring.
Now the installation of the library
for the Husky lens is not as
straightforward as some other
Arduino libraries,
but it's also not that difficult.
Let's start with the Arduino.
Once we're on the Arduino page,
you'll see a code button over here
and you can click that
and download a zip file.
Save it in your downloads directory.
And once it's downloaded,
you can open it with your extractor.
Now once you've got your
file extractor open,
you'll need to navigate within it.
Go under Husky lens over here,
the main directory,
and then there's another Husky lens
directory here.
Extract.
Now go and find your
Arduino library files.
You'll go into your Arduino directory
and then you'll find libraries.
And you can extract over here.
You can close once the extraction
is complete.
And you can also close your web browser.
Now open your Arduino IDE.
We'll expand that.
And then go into file,
go into examples,
and scroll down for examples
for custom libraries.
And you'll now see Husky Lens
with a number of different examples.
And this completes
the installation of the library.
Now we're going to use
one of the example sketches
provided in the Husky Lens library
for our UART connection.
And the sketch we're going to use
is one that they call
Husky Lens Get Started.
I actually think they meant to say
Husky Lens Get Started,
but whatever it is,
start or started,
we're using the Husky Lens library.
And we're also using
the software serial library
for our UART connection.
We define an object called Husky Lens
with the Husky Lens library.
And we use the software serial
in order to establish
a serial connection on the two pins
that we've connected the Husky Lens
to our Arduino with.
Now you could use two other pins.
Any pins other than 0 and 1,
which are already used
by the hardware serial,
like this one over here.
And we also define
a function called Print Result.
And we just do a blank definition
of the function up here.
This is a common technique
used with compilers like Platform.io,
which will give an error message
if this function is called
before it's actually defined.
Now we go into Setup.
We set up our serial monitor,
and we also set up
our software serial connection
at 9600 baud,
to see if the Husky Lens
has been initialized.
If it has been initialized
on that port, we move on.
Otherwise, we print out
some error messages and end.
Now before we go into the loop,
let's move down to the function
called Print Result.
We input a result from the Husky Lens,
and we use commands within the library
to print that result back.
If it is a block,
we break the string down over here
and print it out to the serial monitor.
Otherwise, we just print
that the object is unknown.
Note the use of the F-macro
during the prints.
The F-macro keeps all the data
in ProgMem,
as opposed to passing it
into the Arduino's free memory.
This is important,
especially with an Arduino Uno
that only has 2K of memory,
and it could be easily flooded
with all this data.
Now let's go back up into the loop.
We check a number of connections.
Are we getting data from the Husky Lens?
If not, we print out an error message.
We see if we've learned something,
and if we haven't learned something,
again we print out an error message.
And we also see
if there's something available.
In other words, are we actually
looking at something that we have learned?
And if not,
we'll print out an error message.
Assuming we get past all of those points,
all we do is we print out
a whole bunch of hash marks
in order to distinguish
from the previous line.
And then while the Husky Lens
is actually available,
we will go and print out the results
using the print result function
that we just saw before.
So the sketch has been simplified
by use of the Husky Lens library.
Let's load it up,
connect our Husky Lens,
and take a look at a few things.
So I've got the Husky Lens
tracking a face that I've already memorized.
And as you can see in the serial monitor,
we're getting some data.
This is the block that is tracking the face.
So if we had written a sketch
that needed to know that kind of information,
we can now get it back
from the Husky Lens.
And it's giving us everything
including the ID of the face,
which is face ID number one.
So if we were tracking multiple faces,
we would get data from both of them.
And as you can see,
when the face moves,
the data changes to indicate
the movement in the block.
And if we aren't tracking the face,
we can see it on the screen.
So it's pretty good at relaying the data
back from the Husky Lens
and displaying it on the serial monitor.
And as I said,
you could use that data in another sketch
if you wished.
And so now let's go and do the same thing
all over again,
but this time do it with the I2C interface.
Now when you're using the Husky Lens
with a microcontroller or a microcomputer,
you can use either the I2C
or a serial interface.
And the serial interface
will give you different baud rates.
Now the Husky Lens is capable
of auto-detecting the protocol.
So as they both use the same connections,
it should just be able to figure out
which one you're using
and set itself up accordingly.
But it doesn't always work.
And so you can manually set the protocol as well.
So what you're going to want to do
is going to go over to General.
So move the wheel here
until you get to General
and press down on General.
And you'll get Protocol Type over here.
And you've got a selection
of a number of different serials.
You've got Auto Detect,
which is the fault.
Serial 9600,
which is what we're using
in the experiments we're using today
because we're using a software serial,
so we don't want to go that fast.
But you've got a couple of other baud rates as well.
Or I2C.
So if you see the one that you want,
let's say you want I2C,
you press down on the wheel
and then go back to Save and Return,
and save that.
And then after you do that,
it'll just be set to I2C.
And you'll need to remember that
if you're going to go and use it
in serial mode after that.
And so just a handy hint
in case you're having problems
communicating with your Husky Lens.
For our next experiment,
we'll be using the same two components,
but we'll be connecting the Husky Lens
using the I2C bus.
So disconnect the leads
from the transmit and receive
which is the SDA lead,
will be connected to Arduino pin A4.
And the blue lead,
which is the SCL,
will be connected to Arduino pin A5.
The connection to the ground
and the 5V
will remain as it was in the last experiment.
And this completes the wiring
of our Husky Lens in I2C mode.
Now for our I2C connection,
we'll use another example
that's included with the Husky Lens library,
the Husky Lens I2C example.
And when you look at this,
you will see that this is pretty well
exactly the same code
that we looked at for the UART.
In fact, there really only is one difference
and it is down over here.
Since we're using an I2C connection,
we use the Arduino's
built-in wire library
which we start over here
and then we bind it
to the Husky Lens object over here
instead of binding the UART
like we did in the last one.
This code is absolutely identical
to what we looked at before
so there's really no reason
that we need to go over it a second time.
Let's just load it up to our Arduino
and give it a quick test
to make sure that everything is also working
in I2C mode.
Okay, I've got the I2C demo set up
and this time I'm going to be
trying to track a line.
And the line that I'm going to be tracking
is simply my own finger.
I've just used that and trained it to be a line.
Now right now, you can see
that I've got my finger in the display.
There's no lines on the Husky Lens screen
and the serial monitor is just reading
no block or arrow appears on the screen.
And so if I put my finger in there
and I create a line,
you can see the arrow on the screen
and you'll also see the data
on the serial monitor.
And this time the data that it's giving
is the origin and the target coordinates.
So the bottom and the top of the arrow
and as I move my finger
and change the direction
and the size of the arrow,
you can see those coordinates change.
And again, you could be using
those coordinates in a sketch
or something that is trying to follow a line,
for example, could use those coordinates
to guide itself.
And so once again,
another method of getting data back
from the Husky Lens,
this time using the I2C connection.
Now when we ran the Husky Lens
in face and object recognition mode,
we assigned the label to every face
and object that we detected
and it usually went something
like ID1, ID2, etc.
And while that's fine,
it's not particularly descriptive.
So now that we have an Arduino
hooked up to our Husky Lens,
we can go back and change
those descriptions to something
a little bit more useful to us.
So let's go and use our Arduino
with the Husky Lens
to put a name to the face.
So to set up our experiment,
I've scanned four faces
into our Husky Lens.
It's a little hard to get them
all to display at the same time,
but they're currently face IDs
one through four.
Now what we'll do is we'll run
a little bit of Arduino code
that can change those face IDs
into something more memorable.
Now here's a sketch that we can run
to assign names to the faces
that we've detected in the Husky Lens.
And you can actually use this
for example if you classified them.
You can use this same method
to name them.
You can even use this
with the April tags if you wish.
It's a very simple sketch.
It starts off with the libraries we need,
which is the Husky Lens library
and the wire library for I2C.
Then we create an object
called Husky Lens
to represent our Husky Lens.
Now I've defined a function over here,
and this function is actually
where everything happens.
This is the ID number
that we're trying to set the name for.
And what it does is it calls a method
that's part of the Husky Lens library
that does exactly this.
It's called setCustomName
and you insert the name and the ID.
Now the reason I've put this inside a function
is that it's enabled me
to put it in this while loop
because sometimes it doesn't work
the first time and you need to delay
and go and do it again.
So instead of just calling
setCustomName a number of times
I've found this to be a bit more reliable
by just sticking it in its own function.
At any rate,
everything happens in this setup.
We start our serial monitor
and the only purpose of the serial monitor
is that the setNewName function
does use it in case the name setting fails
so you can use it to troubleshoot.
Then we connect to the I2C bus as a master
by not providing any address inside here.
And we'll bind the Husky Lens
to the I2C connection
as we've done before.
And then we insert a short delay
to allow everything to stabilize.
And then after that
we can call setNewName
four different times
to change the four different names.
So we're going to change ID number 1 to John,
number 2 to Paul,
number 3 to George,
and number 4 to Ringo.
And then once we've defined the FAB4
we can exit our setup.
In the loop there's nothing here
because we've done all the work inside the setup.
So let's go and upload this
and change the names to the faces.
So I'm about to upload our sketch
to the Husky Lens
and when I do the upload
there's a very brief little bit of indication
on the screen.
So if you observe very quickly
you might see that.
I'm going to do the upload right now.
And there you go on the screen.
And now it's uploaded.
And now you'll notice
my second one now says Paul.
And if I can just move this around.
Let's see, there's John,
and so we have now identified
the faces that the Husky Lens has memorized.
Now one other feature of the Husky Lens
is that it has a micro SD card.
And this card can be used
for a couple of purposes.
You can use it to store photos
or screenshots.
And the difference between a photo and a screenshot
is that a screenshot has all of the text data
that we've seen on our screen
whereas the photo is everything
without the text data.
Another thing you can use
for is to store the training models
that you've used.
And so let's go and take a look
at how we do that
with the Husky Lens micro SD.
So I've inserted the micro SD card
into my Husky Lens.
There's a socket on the front
of the Husky Lens for the card.
And I'd advise that you angle yourself
so that you can see the inside of that socket.
And it will make it a lot easier
for you to install the card.
Once you've done that
you can start saving the things
that I've shown you guys over here.
I'm going to try to save that
to my micro SD card.
So I'm in face recognition mode.
Press down to get the menu at the bottom.
Go all the way to the end
to export to SD card.
Now press down.
And I get these numbers here
and I can scroll through these
to let me know what number I want.
You've got 0 through 5.
I'm going to press down so I get 0.
And so now it's been exported to the SD card.
And so let's just get out of here.
Let's go back to general settings.
Press down on that.
And I'm going to go do a factory reset now.
So it's going to reset my Husky Lens.
And now as you can see
all I'm seeing now are faces.
I'm not recognizing any of these fellows anymore.
So I'm in face recognition mode.
I'm going to go down to the bottom again.
I'm going to do an import from the SD card.
I'm going to import number 0.
And then what I have to do
is I have to reset my Husky Lens
by powering it off and on.
And there you go now.
We're recognizing the faces again.
You can see Paul, George, and Ringo over here.
So the data from the micro SD card
has been imported back into the Husky Lens.
And you can save 5 parameters
for every Husky Lens function.
And so that wraps up today's look at the Husky Lens.
I think you can see that this very powerful device
can allow you to add
artificial intelligence based object recognition
to any of your projects.
And you can use these for a number of applications.
Whether you want to build a front doorbell
that actually recognizes who's at the door.
Or if you just want to count cows.
Now I've got another application
I'm using the Husky Lens for.
And I've got it right over here.
It's something I've been working on for a little while.
And as you can see,
it's one of these little robot car bases
to which I've attached a Husky Lens.
And this can already follow objects around.
And I'm going to get it to try to do
a few of the other Husky Lens features.
Once I have it together,
I will create a video and an article about it.
So if you want to see that video,
the best way to find out about it
is to subscribe to the channel.
And all you need to do is hit that subscribe button.
And also click on the bell notification.
And if you do that,
and if you have notifications enabled
on your YouTube account,
you'll get notified every time I make a new video.
Be it on the Husky Lens,
or anything else.
Now if you want a little bit more information
or you want to get some of the sketches,
just head over to the article
that accompanies this video
on the DroneBotWorkshop.com website.
And you'll find a link to that article
right below the video.
While you're on the website,
please consider joining the newsletter.
It's a letter I send out every now and then.
Just to let you know what's going on
in the workshop.
And of course it's absolutely free.
And another thing that's absolutely free
is the DroneBot Workshop forums
where you can discuss this video
with a number of like-minded people
who are there just to help you out.
So a lot of resources for you.
So until we meet the next time,
please take care of yourself.
Please stay safe.
And I'll see you again very soon
here in the DroneBot Workshop.
Goodbye for now.
