Hi and welcome to section territory where we took a look at using Yellow Bridge entry in Open City.
So let's open this notebook and let's load off libraries and the functions.
And before we get started, we have two more sessions open, so let's close a bunch of them that we're
no longer using, which are you expect you to do if you're doing this with consecutive lessons?
So let's take a look at what YOLO is.
YOLO is a very cool, and because it's so good at object object detection, it's an object detector
of sounds for you.
Only look once, which means it's a single stage.
Object detector will do object detection detectors much later on in this course, because it's quite
a deep topic under many different object detectors out right now.
But YOLO is perhaps the best.
It's my favorite one to use.
Gives me the best performance almost every time I use it.
And well, what we have here now is just a very easy way to load a YOLO model in open.
No, I believe right now you'll end up, and it only supports up to elevation tree models.
However, I do believe that the guys at ultraorthodox have made some changes or have made some contributions
to the open TV library that allows it to load it.
You'll have five models, which would be amazing.
I don't think it's ready yet, but it might be by the time you're starting this course.
So let's take a look at the what would we do as a human model in open TV.
So to do that, I have some steps involved here which should be in order.
It's not really that complicated here.
This is the same here, so it's already completed, fully complete, actually.
It's only because this line here it runs.
Just an example could.
Why didn't we find the model now?
Take a look.
They will not run this, we didn't run that badly.
So that's your model, and you can see it shouldn't zip everything dear.
Shouldn't take too long.
Well, it's a few hundred makes it leave and yeah, we do.
So we have you and the role model and images.
So now this should work.
So there we go.
So what this code illustrates here is just us losing the model and inspecting the model.
So we load the rebel limbs pointing to this cookie with our names.
Now, cuckoo is some sort of common object dataset.
It's one of the three, actually.
Actually, it's the image that which you don't know an image that is yet to explain that to you and
little slides, but image, net and cocoa all these vast datasets for images.
Cocoa is the object detection detector dataset.
Image net is a classified dataset, which has proven invaluable for computer vision research.
It's quite big.
It's over a million images, so it took quite a number of people in quite a while to annotate the data.
Cocoa similarly has thousands and thousands of images into objects.
I believe in this one.
Cocoa is also cocoa 122 and cocoa 80, so it's 80 object classes, so you can take a look at this cocoa
that lives.
Let's take a look at that file.
So let's fine with the.
We can see it here, and you can actually preview the file.
So these are the E.T. object classes.
That object detector can detect two things like birds, sheep, horses, elephants, people and motorbikes.
It's quite a number of common causes.
Yeah, so it's quite good.
So we also have two of the files here CFC, which is the model structure, and you can see it here.
It's quite long.
This defines the whole model structure for yellow that's coded in their field of vision, tree and widths,
which is a 250 make file.
I believe that stores all the values and weight values for that big model here.
And then we use this function.
This is the DNN read from darknet to lower the model.
So we we'll see if she put as well as the weights.
And then we just send it back in to Greece.
Open TV back in for this one.
Depending on the hardware you're using, you can get a different back and you can use.
But for now, it's just use standard open TV backend and we use dot net that dot cuddly animals just
to illustrate the names, the 254 different layers in this model.
And you can print this in this big, long list here to see it if you want to just take a look, inspect
the deepness of this model so there's no point to.
But just forgive us curiosity sake.
We can do it.
So let's take a look at the function that we're going to use here.
So we have DNN Blob from image.
This transforms the image as we loaded into input.
Possesses that image so that we can now feed that image into our little model detector.
And then we have this other function here that takes that blob and calls it blob from image.
Sorry.
It's the same function here.
Sorry, it's just an example of the properties that we can use here, so we can define a size scaling
factors, whether we swap a, b and whatever cropping the sensor or not.
So let's move on to actually using yellow in open city.
So we're going to set the path.
We have a bunch of images here and we just get those images out by using this, this comprehension here.
This this list gives you all the file names in this directory, and we loop through each file name.
We load the image, get the height and weight, convert it into into a blob.
Then we passed the blob to our dot net here and then do a forward pass, not dot forward with the output.
So actually, this should we come to that because it millennium's if we need to get and then from that,
we just create this reuse here.
This is where we get it down in boxes, confidence and ideas.
So for the outputs of that and the outputs, we guess loops, you iterate through that, we get the
detections from there, as well as confidence scores and class sizes and anything that has a confidence
score above one above 0.75.
We draw it onto the image and copy it out as well.
If we wanted to store those images and then we apply something called on maximum suppression and mass
to basically get rid of overlapping bounding boxes so that it looks a bit cleaner.
And this is where we actually draw the binary boxes here.
Sorry, so it.
Enjoy this or it's going to disappear quickly.
But this is us where we actually just get the bounding box as well.
All right.
So we just stored the boxes there.
We applied and invested it, and then we just draw the final boxes from here into the image.
So let's run.
This consists a lot going on there, but it's actually quite faster and inferences using yellow.
It's what it's famous for.
So you can see here, this is great.
This is got to cup my cup.
That was my little vacation I went to as well.
So got the dog correct.
Got this bottle of rum and a cup behind it.
Correct?
It got the bus.
People were sending a few people, some cars here, so it's quite good.
This one gets all the cups as well.
And it got me and the ball isn't that hard to see.
But this person and this is sports more, I believe.
Discipline got truck this one.
It got all the potted plant and sea levels here.
This one says ruins.
I think it's a bit hard to see, but you can inspect the springs directly or you can even increase the
size if you wanted it.
This one, this cup, there's a small element, so it's a big.
That's why it looks a big.
It's so much bigger.
So that's it for using yellow and open.
To be a good exercise for you to do is to run yellow on a video.
You remember that all the all the previous examples we had with videos and club where we used a video
writer.
And then we just played it back into club.
Get a sample VIDEO Download something from YouTube or wherever you want and run you on it.
It's a good exercise for you to get used to using yellow on videos, so thank you.
And now let's move on to the next lesson which is implementing neural style transfer would open TV.
So stay tuned for that.
Thank you.