WEBVTT

00:00.120 --> 00:07.880
We converted the normalized center to pixel coordinates, and we succeeded in drawing the bounding box

00:08.160 --> 00:15.400
and applying clamping boundaries to contour to ensure the rectangle stays within the visible screen.

00:15.440 --> 00:17.720
Now let's scroll up.

00:17.840 --> 00:18.160
Here.

00:18.160 --> 00:24.880
We created the results, which is a mutable list of detection object and we need to return it.

00:24.880 --> 00:31.120
So for this purpose we need to return the results dot sorted by ascending.

00:31.440 --> 00:35.240
But our results mutable list is empty.

00:35.480 --> 00:38.640
So here results dot add.

00:38.680 --> 00:42.840
We need to add this detection object detection object.

00:42.840 --> 00:49.280
And if we open the detection object we need to pass three parameters score, label and bounding box.

00:49.600 --> 00:57.360
The first uh the first is the score, the second is label and the third is the bounding box.

00:57.400 --> 00:57.840
Okay.

00:58.200 --> 01:01.320
This is the bounding box which is the rectangle okay.

01:01.600 --> 01:03.000
This is the results dot.

01:03.040 --> 01:08.420
Add the detection object and return results dot sorted by ascending.

01:08.540 --> 01:17.980
Let's try to run our application and see if there is any missing, uh, functions, any missing, uh,

01:18.220 --> 01:19.860
things we need to do.

01:19.900 --> 01:22.260
For example, this is the tensor image.

01:22.460 --> 01:26.860
Um, we missed to add it, but let me see.

01:26.900 --> 01:30.060
Let me run at first and see if there is any errors.

01:30.100 --> 01:35.460
This is our app working fine but it's not detecting any objects.

01:35.460 --> 01:38.780
So we need to check our codes.

01:38.820 --> 01:43.220
Let me scroll to the tensor image here.

01:43.340 --> 01:48.140
I've used the input buffer instead of using the tensor image.

01:48.140 --> 01:49.780
So input.

01:50.020 --> 01:55.540
Let me check the tensor image the tensor image dot buffer.

01:55.820 --> 02:01.860
So change the input buffer in to tensor image dot buffer.

02:02.140 --> 02:03.500
Let me run again.

02:03.540 --> 02:08.410
Here we have our application and it's detecting the battery.

02:08.450 --> 02:10.050
Let me run it again.

02:10.090 --> 02:10.850
Here we go.

02:10.890 --> 02:16.290
You see, guys, we are detecting the batteries, but our application is crashing.

02:16.570 --> 02:19.850
Let me check the the logcat.

02:19.890 --> 02:22.170
And by the way, congratulations, guys.

02:22.170 --> 02:23.930
This is a complex application.

02:23.930 --> 02:27.770
We are making our custom object detection application.

02:27.810 --> 02:36.250
Okay, if we check here we have this error array index out of bounds exception links.

02:36.250 --> 02:38.650
Fix six and index six.

02:38.810 --> 02:42.450
Array list dot get and drop boxes Lambda.

02:42.490 --> 02:43.970
Let me check that.

02:43.970 --> 02:48.290
Drop boxes dot key file and the error here.

02:48.290 --> 02:52.570
Inside draw a path color list.

02:52.570 --> 02:54.770
Let me check the color path.

02:55.090 --> 02:56.730
It's a list of colors.

02:56.770 --> 03:01.810
Go to to that list of colors that we passed for the drop boxes.

03:01.850 --> 03:09.090
I think it's in the object detector, so scroll up.

03:09.250 --> 03:13.950
Search for search for um path color list.

03:13.950 --> 03:20.950
So ctrl f path color list and apply at index I to the RGB.

03:20.990 --> 03:24.350
So maybe there is many detections.

03:24.350 --> 03:34.990
If you see guys there are a lot of detections and overlap detections um, on uh on the screen and it's

03:35.150 --> 03:39.310
uh it's not for example checking for the colors.

03:39.310 --> 03:40.710
We have six colors.

03:40.710 --> 03:41.990
Let me check guys.

03:42.150 --> 03:44.990
So open that detection screen.

03:45.150 --> 03:51.470
And here we have six parameters green, cyan, red, yellow magenta and black.

03:51.830 --> 03:55.070
And if you notice that the black box is drawn.

03:55.070 --> 03:59.830
So we reached the maximum size of this color list.

03:59.830 --> 04:05.190
Let me add the new colors in order to solve the problem.

04:05.190 --> 04:15.740
Also we can uh right here in order to prevent any errors, we can make a modulus or repeating the colors

04:15.780 --> 04:16.340
again.

04:16.580 --> 04:21.540
Okay, but since for for now we've added four more colors.

04:21.540 --> 04:28.060
When you reach white color, then the next detected one will make an error.

04:28.340 --> 04:31.140
Okay, let me test this application.

04:31.140 --> 04:37.380
And notice if if this the the real problem here is the detection.

04:37.380 --> 04:38.780
And it's working fine.

04:38.820 --> 04:42.740
Now you see guys everything is working fine.

04:42.740 --> 04:44.500
And congratulations.

04:44.700 --> 04:47.460
This is our lovely application.

04:47.500 --> 04:48.940
Those are two batteries.

04:48.940 --> 04:50.300
Let me test okay.

04:50.340 --> 04:51.540
You see guys, we are.

04:51.740 --> 04:54.940
We are detecting two batteries.

04:55.340 --> 04:56.340
Let me see.

04:56.780 --> 05:00.620
And this is what we trained our model, uh, for.

05:00.900 --> 05:04.540
So this is our lovely application.

05:04.580 --> 05:05.140
Okay.

05:05.420 --> 05:10.420
So congratulations, guys, and thank you for following me.
