WEBVTT

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

00:01.240 --> 00:04.760
We exported our model as Tflite.

00:04.800 --> 00:06.120
We have two versions.

00:06.320 --> 00:12.680
The 32 and 16 use 16 dot tflite.

00:12.720 --> 00:19.520
If you are deploying to mobile devices or edge devices, the file size and memory are concerns.

00:19.800 --> 00:29.600
If you need faster inference speed, or if your hardware supports 16 bit operations, or if a tiny accuracy

00:29.600 --> 00:35.400
drop is acceptable for your use case, use best float32.

00:35.440 --> 00:41.440
If you have maximum accuracy is critical, like medical imaging and safety systems.

00:41.720 --> 00:50.360
If you are using hardware older hardware without 16 bit support, if you encounter numerical instability

00:50.360 --> 00:56.720
with the Float16 version and the file size and speed are not primarily concerns.

00:56.760 --> 00:57.240
Okay.

00:57.440 --> 01:04.000
So in our application we're going to start with the best Float16 Tflite.

01:04.000 --> 01:10.850
Because the accuracy difference is usually very small, you get significant benefits in size and speed,

01:10.890 --> 01:14.650
and most modern devices handle it well.

01:14.690 --> 01:15.210
Okay.

01:15.250 --> 01:22.490
And also we are detecting only one object, so it's not a big difference and not a big deal.

01:22.530 --> 01:25.810
Okay, so best Float16 16 dot Tflite.

01:25.850 --> 01:27.610
This is our model.

01:27.650 --> 01:30.770
Now let's understand the model's shapes.

01:30.850 --> 01:33.650
We have input and output tensors.

01:33.930 --> 01:37.450
In order to understand it you can write the code here.

01:37.450 --> 01:40.930
And there is another way which is.

01:40.970 --> 01:50.850
Net dot net dot app is a very amazing website that allows you to read your models, hierarchy, input

01:50.850 --> 01:54.810
and output, copy it and open the model.

01:54.850 --> 01:58.330
Here we have the model, the inputs and outputs.

01:58.610 --> 02:04.450
The most important thing we need to get and understand is the tensor.

02:04.490 --> 02:12.090
The input tensor, which is a float32 one 640 640 and three.

02:12.410 --> 02:20.900
We talked about this in the previous videos and for for understanding well those and the without forgetting

02:20.940 --> 02:25.300
them, open a new new notebook, a new notepad.

02:25.300 --> 02:29.980
Copy the outputs in order to understand them well.

02:30.020 --> 02:34.500
Okay, so this is our output and this is our input.

02:34.540 --> 02:35.100
Okay.

02:35.220 --> 02:43.820
Before a deep dive or deep diving into the input and output tensors, let me show you the other method

02:43.820 --> 02:46.540
to get the model's shape.

02:46.540 --> 02:55.340
Create a new variable called interpreter equals to df dot light dot interpreter.

02:55.500 --> 02:59.340
And here we need to pass the model path.

02:59.380 --> 03:00.460
Model path.

03:00.780 --> 03:02.340
Where is our model.

03:02.340 --> 03:06.100
It's here the best float 16.

03:06.100 --> 03:16.580
Copy the path and paste it here okay then interpreter dot allocate tensors input details interpreter

03:16.580 --> 03:19.180
dot get input details and output details.

03:19.180 --> 03:22.380
Interpreter dot get output details.

03:22.420 --> 03:25.060
Input shape get the shape.

03:25.100 --> 03:30.620
You can get the input details the shape and the output shape.

03:30.660 --> 03:32.940
Output details at index zero.

03:32.980 --> 03:34.620
Let me run this cell.

03:34.660 --> 03:36.140
Here I think.

03:36.420 --> 03:39.020
Let me add the libraries.

03:39.020 --> 03:42.180
Import TensorFlow STF.

03:42.380 --> 03:43.020
Run.

03:43.060 --> 03:43.500
Oops.

03:43.700 --> 03:47.260
The model path equals not to not to points.

03:47.260 --> 03:49.340
And let me run this.

03:49.380 --> 03:51.820
We need to display them.

03:51.900 --> 03:55.180
So in order to display the input shape copy it.

03:55.180 --> 03:59.740
And here the output shape copy it and paste it here.

03:59.980 --> 04:02.700
Run the cell again and here we go guys.

04:02.700 --> 04:05.500
We get an array for the input shape.

04:05.540 --> 04:13.380
The input shape is one six 4640 and three data type integer 32.

04:13.580 --> 04:19.500
And the output shape is one five 8400.

04:19.580 --> 04:22.620
And the data type is integer 32.

04:22.740 --> 04:28.340
Okay, this is how we get the information about the model's shape.

04:28.460 --> 04:34.940
In the next video, we're going to learn about the input and output of YOLO models.
