WEBVTT

00:00.080 --> 00:01.000
Welcome back.

00:01.000 --> 00:05.280
Now we need to draw this bounding box as I said to you.

00:05.520 --> 00:11.720
This returns a y minimum, x minimum, y maximum and x maximum.

00:11.800 --> 00:13.920
We need to convert it to a rect f.

00:14.240 --> 00:18.000
We need to display this on our canvas.

00:18.000 --> 00:18.880
So for that.

00:19.000 --> 00:23.120
Val rect f we need to pass four parameters.

00:23.480 --> 00:27.880
The bounding box dot result view size with the width.

00:28.120 --> 00:29.600
This is for x minimum.

00:29.800 --> 00:32.160
This is for y minimum.

00:32.160 --> 00:38.840
This is the width is for x maximum and this is for the y maximum.

00:38.880 --> 00:41.800
Okay let me make the labels here.

00:41.800 --> 00:48.840
If you notice we started from one bounding box one which is the left x minimum.

00:48.880 --> 00:50.240
This is the standard.

00:50.360 --> 00:54.280
Then we need to pass the top which is y minimum.

00:54.360 --> 01:02.920
The right is three bounding box three index three which is x maximum, and bounding box two which is

01:02.920 --> 01:05.200
the button y maximum.

01:05.520 --> 01:06.040
Okay.

01:06.520 --> 01:12.210
This is what we we need to do in order to display the rectangle.

01:12.250 --> 01:17.810
Now only add if the rectangle is valid.

01:17.810 --> 01:28.650
What we need to do if rect dot width if rect dot width greater than zero and rect height greater than

01:28.690 --> 01:35.690
zero and rect left greater than zero and rect top greater than zero.

01:35.890 --> 01:37.010
What we need to do.

01:37.290 --> 01:44.610
We need to set the results, the detection results or the detection object.

01:44.650 --> 01:48.290
Dot add detection object rect.

01:48.610 --> 01:55.690
Replace it with a score because the first parameter is the score, the second parameter is the label.

01:55.690 --> 02:03.450
The third parameter is the bounding box, which is the rectangle that we created just before okay,

02:03.570 --> 02:04.650
only if valid.

02:04.650 --> 02:07.130
Go and add this rectangle.

02:07.170 --> 02:13.490
Now we need to return result and the detected results.

02:13.530 --> 02:18.950
Detected objects Dot sort by descending.

02:19.150 --> 02:22.310
Descending according to its score.

02:22.430 --> 02:22.910
Okay.

02:23.110 --> 02:23.670
Dot.

02:23.710 --> 02:25.350
Take default.

02:25.390 --> 02:27.230
Maximum results.

02:27.270 --> 02:28.710
This is for the.

02:28.910 --> 02:31.150
And this is for.

02:31.190 --> 02:31.830
Okay.

02:31.870 --> 02:36.030
We need to change it to sorted by and not sort by.

02:36.070 --> 02:38.630
It's sorted by and take.

02:38.910 --> 02:41.430
This is not a lambda expression.

02:41.430 --> 02:45.670
It takes the default maximum results.

02:45.710 --> 02:46.190
Okay.

02:46.470 --> 02:50.390
This is our parse detection results.

02:50.390 --> 02:53.110
Here we are drawing the rectangle.

02:53.270 --> 02:59.870
It's a very important to understand the sequence the left top right and bottom.

02:59.990 --> 03:06.590
The left is the x minimum which is the the second element in the bounding box.

03:06.910 --> 03:10.910
The top is the first element in the bounding box.

03:10.990 --> 03:13.630
The right is bounding box.

03:14.270 --> 03:16.750
Fourth element and the bounding box.

03:16.750 --> 03:19.390
Third element is the bottom.
