WEBVTT

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

00:01.000 --> 00:06.320
Now let's export our model select TensorFlow Lite.

00:06.320 --> 00:10.840
So here we have floating point quantized and edge TPU.

00:11.240 --> 00:13.760
Go and select floating point.

00:13.760 --> 00:18.720
And here we have the like a documentation how to use this.

00:18.720 --> 00:23.680
So don't worry we're going to use it in a better and a professional way.

00:24.000 --> 00:25.560
Download my model.

00:25.560 --> 00:29.040
It's converting the model to TF Lite.

00:29.080 --> 00:30.800
Please be patient.

00:30.840 --> 00:33.040
Converting model takes some time.

00:33.280 --> 00:36.200
And here we have the converted TF Lite.

00:36.240 --> 00:37.400
Let me open it.

00:37.440 --> 00:38.400
It's here.

00:38.600 --> 00:41.520
Copy it and go to the desktop.

00:41.640 --> 00:43.560
Create a new folder.

00:43.840 --> 00:47.240
And here name it as Object detection.

00:47.280 --> 00:48.440
Extract it.

00:48.440 --> 00:55.800
And you see guys we have two files the label and the model.tf Lite.

00:55.840 --> 01:05.160
This is the model of the object detection and the classification of um, the hard disk and the airports

01:05.160 --> 01:11.270
that we're going to put in Android and this is the labels dot txt open it.

01:11.510 --> 01:17.310
You see guys we have two classes hard disk and AirPods.

01:17.390 --> 01:27.670
So it's very important to keep them and understand that we need to put those two files in Android Studio

01:27.710 --> 01:28.230
okay.

01:28.510 --> 01:31.350
So let's start building our application.

01:31.390 --> 01:36.590
Open Android Studio, create a new project empty compose activity.

01:36.790 --> 01:43.470
Select next and the name of the application would be Gadgets Detection App.

01:43.590 --> 01:44.390
Click finish.

01:44.590 --> 01:53.230
Also, you can name it as Gadgets Classifications app because this is a classification app and not actually

01:53.270 --> 01:54.710
the object detection.

01:54.830 --> 02:01.670
In the next sections, we're going to learn about object detections and we're gonna create our custom

02:01.710 --> 02:02.950
object detections.

02:02.950 --> 02:11.180
And we're going to use the pre-trained and pre and ready made object detections models.

02:11.220 --> 02:11.740
Okay.

02:11.780 --> 02:17.580
So in this application it's an image classification as usual.

02:17.700 --> 02:20.700
Let's start adding our model.

02:20.820 --> 02:25.580
So go to the others TensorFlow Lite model.

02:25.780 --> 02:29.620
Select the model location from the desktop.

02:29.860 --> 02:31.660
It's an object detection.

02:31.660 --> 02:35.820
And this is the name model underscore unquantized.

02:35.860 --> 02:40.340
I'll name it as HDD AirPods model.

02:40.380 --> 02:40.900
Okay.

02:41.100 --> 02:41.860
Copy it.

02:41.900 --> 02:49.020
Click open automatically add features and dependencies and you can use the GPU dependencies.

02:49.020 --> 02:51.740
So click okay and finish.

02:51.740 --> 02:56.380
Let's add some dependencies for TensorFlow.

02:56.380 --> 03:06.260
So here you see guys that whenever you import the gadgets TensorFlow Lite model into your uh into your

03:06.260 --> 03:07.620
resources folder.

03:07.620 --> 03:17.730
And once the ML package being created you see that the TensorFlow Lite GPU meta and support dependencies

03:17.730 --> 03:20.130
are being added automatically.

03:20.330 --> 03:24.370
Now let's add the other dependencies for TensorFlow.

03:24.650 --> 03:27.810
And here start with implementation.

03:27.810 --> 03:33.850
I'm gonna use the 2.17 version of TensorFlow.

03:34.050 --> 03:42.210
That GPU is being added above, so you can cut those and paste them here in order to organize our code.

03:42.210 --> 03:51.170
And one important note here that since we're going to use the camera, we need to add the dependency

03:51.170 --> 03:52.570
of this camera.

03:52.570 --> 03:57.810
So go to Google search for Android Camera.

03:57.810 --> 03:59.930
And here we have camera X.

03:59.970 --> 04:03.090
You see also we have camera two.

04:03.410 --> 04:07.410
It's the latest version stable version 1.5.0.

04:07.610 --> 04:13.410
Scroll down to get the dependencies and let me add the dependency for the camera two.

04:13.450 --> 04:22.240
So here Android X camera camera two get the latest version of camera version two, which is 1.5.

04:22.240 --> 04:28.280
I like to use the most stable one, so I'm not gonna use 1.6.

04:28.280 --> 04:33.600
I'm gonna use the 1.5.1.

04:33.880 --> 04:34.400
Okay.

04:34.720 --> 04:35.680
Scroll up.

04:35.720 --> 04:36.520
You can see it.

04:36.520 --> 04:38.120
This is the latest version.

04:38.120 --> 04:46.600
Also, if you want to additionally use Camerax Lifecycle library, you can copy this and paste it here.

04:46.760 --> 04:49.240
We need to get the camera view.

04:49.400 --> 04:53.320
So here copy this paste it here.

04:53.560 --> 04:59.640
Also you can set additionally add camera kit vision integration.

04:59.960 --> 05:05.080
Those are for the next videos and the next uh applications.

05:05.080 --> 05:08.080
But for now we're going to make it simple.

05:08.280 --> 05:11.000
So this is the camera dependencies.

05:11.000 --> 05:14.520
And those are the TensorFlow dependencies.

05:14.560 --> 05:18.360
Sync the project and wait for Android Studio to finish the build.

05:18.400 --> 05:19.080
Gradle.
