WEBVTT

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

00:01.000 --> 00:07.680
In order to save time, we're going to update the codes of the previous section.

00:07.680 --> 00:15.000
So I created this project Object Detection SSD app in the previous section.

00:15.160 --> 00:24.760
Go and open it in order to update some codes and add the model to the ML package and run it.

00:24.800 --> 00:25.240
Okay.

00:25.280 --> 00:32.240
It's similar to what we've done before, but we need to change and the codes according to the model

00:32.240 --> 00:32.960
shapes.

00:33.200 --> 00:33.720
Okay.

00:33.920 --> 00:40.040
So the manifest we should create the the permission of the camera.

00:40.160 --> 00:45.280
Also you can create your own um, and new uh, project.

00:45.400 --> 00:54.560
Uh, but you should include the, those codes, the permissions for the manifest inside Gradle we should

00:54.600 --> 00:56.720
include TensorFlow.

00:56.760 --> 01:01.040
We should include Camerax permission and hilt.

01:01.080 --> 01:07.680
We talked about hilt in the previous sections and in the previous videos.

01:07.680 --> 01:13.160
So we need to add those, um, those plugins and also add the project level.

01:13.160 --> 01:15.120
We should add those okay.

01:15.400 --> 01:23.080
So those are the permissions and the libraries needed to work with our application.

01:23.080 --> 01:29.640
Now delete this ML package and delete the Coco data set.

01:29.680 --> 01:34.320
Now let's add a new model that we created.

01:34.320 --> 01:34.880
Before.

01:34.920 --> 01:44.240
Go to the downloads, copy the best Float16 the Tflite to the ML and here we go.

01:44.280 --> 01:50.480
Now create a new file, name it as labels dot txt.

01:50.520 --> 01:55.640
Inside this label we need to add the object classes.

01:55.640 --> 02:02.240
So all the classes that you annotate in Roboflow you should add it here.

02:02.360 --> 02:05.120
Okay, we have only one.

02:05.400 --> 02:09.480
Um, we have only one class which is the battery.

02:09.480 --> 02:17.200
So if you remember, the class is named battery and you should write it exactly as you specified in

02:17.200 --> 02:21.720
Roboflow and in your, um, in your data set.

02:21.760 --> 02:22.200
Okay.

02:22.240 --> 02:29.760
So this is the labels dot txt and this is the best Float16 Tflite this those are the three steps we've

02:29.760 --> 02:37.760
done before the manifest, the Build.gradle and the best Float16 Tflite and labels.

02:37.800 --> 02:41.720
Now let's start examine every uh, every class.

02:41.720 --> 02:46.320
So here the response inside the util we have this class.

02:46.360 --> 02:51.760
It's, uh, we don't need to make anything uh, any update to it.

02:51.800 --> 02:59.440
We have loading success and failure as we told the talked about it in the previous videos, this class

02:59.440 --> 03:08.360
represents the possible states of a synchronous operation or API response out of T.

03:08.400 --> 03:15.810
This is the type T indicates that that type parameter t is covenant.

03:15.850 --> 03:20.690
You can use response of dog where response animal is expected.

03:20.690 --> 03:30.410
So this is can be this can be uh like understood in this way response of dog where response animal is

03:30.410 --> 03:31.330
expected.

03:31.370 --> 03:31.850
Okay.

03:31.890 --> 03:35.530
So this is the type T detection object.

03:35.730 --> 03:41.250
We have this detection objects as uh similar to what we've done before.

03:41.490 --> 03:47.970
It's a data class contains the score label and the bounding box.

03:48.090 --> 03:53.170
The detection parameters also similar to what we've done before.

03:53.450 --> 03:59.210
So those three classes, we don't need to make any change inside them.

03:59.250 --> 04:02.770
Also I'll skip the object detector for now.

04:03.010 --> 04:04.770
Camera permission wrapper.

04:04.970 --> 04:08.290
There's nothing to do with this file.

04:08.330 --> 04:09.730
Camera preview.

04:10.090 --> 04:12.250
I'll skip it for later.

04:12.330 --> 04:15.050
Uh, edit the detection screen.

04:15.090 --> 04:16.970
No need to do anything.

04:17.170 --> 04:21.370
Of course the detection view model we're going to update it.

04:21.410 --> 04:22.530
The detection app.

04:22.530 --> 04:26.890
No need to uh to do anything any update.

04:26.930 --> 04:28.170
The main activity.

04:28.330 --> 04:29.930
No need to do anything.

04:29.930 --> 04:35.130
So we're going to update the detection view model.

04:35.330 --> 04:39.010
We're going to update the object detector.

04:39.130 --> 04:43.050
And if there is any error we're going to update the corresponding files.

04:43.050 --> 04:47.170
But for now we uh added the permission.

04:47.370 --> 04:54.490
We added that Gradle libraries and the model best Float16 Tflite.

04:54.490 --> 04:58.850
And the label and those classes are similar.

04:58.890 --> 05:06.210
The response detection, object detection parameter, camera permission wrapper, camera preview, the

05:06.530 --> 05:10.290
drill boxes, detection app and main activity.

05:10.450 --> 05:16.490
We're going to update the object detector detection screen and detection view model.
