Welcome back.
We exported our model as Tflite.
We have two versions.
The 32 and 16 use 16 dot tflite.
If you are deploying to mobile devices or edge devices, the file size and memory are concerns.
If you need faster inference speed, or if your hardware supports 16 bit operations, or if a tiny accuracy
drop is acceptable for your use case, use best float32.
If you have maximum accuracy is critical, like medical imaging and safety systems.
If you are using hardware older hardware without 16 bit support, if you encounter numerical instability
with the Float16 version and the file size and speed are not primarily concerns.
Okay.
So in our application we're going to start with the best Float16 Tflite.
Because the accuracy difference is usually very small, you get significant benefits in size and speed,
and most modern devices handle it well.
Okay.
And also we are detecting only one object, so it's not a big difference and not a big deal.
Okay, so best Float16 16 dot Tflite.
This is our model.
Now let's understand the model's shapes.
We have input and output tensors.
In order to understand it you can write the code here.
And there is another way which is.
Net dot net dot app is a very amazing website that allows you to read your models, hierarchy, input
and output, copy it and open the model.
Here we have the model, the inputs and outputs.
The most important thing we need to get and understand is the tensor.
The input tensor, which is a float32 one 640 640 and three.
We talked about this in the previous videos and for for understanding well those and the without forgetting
them, open a new new notebook, a new notepad.
Copy the outputs in order to understand them well.
Okay, so this is our output and this is our input.
Okay.
Before a deep dive or deep diving into the input and output tensors, let me show you the other method
to get the model's shape.
Create a new variable called interpreter equals to df dot light dot interpreter.
And here we need to pass the model path.
Model path.
Where is our model.
It's here the best float 16.
Copy the path and paste it here okay then interpreter dot allocate tensors input details interpreter
dot get input details and output details.
Interpreter dot get output details.
Input shape get the shape.
You can get the input details the shape and the output shape.
Output details at index zero.
Let me run this cell.
Here I think.
Let me add the libraries.
Import TensorFlow STF.
Run.
Oops.
The model path equals not to not to points.
And let me run this.
We need to display them.
So in order to display the input shape copy it.
And here the output shape copy it and paste it here.
Run the cell again and here we go guys.
We get an array for the input shape.
The input shape is one six 4640 and three data type integer 32.
And the output shape is one five 8400.
And the data type is integer 32.
Okay, this is how we get the information about the model's shape.
In the next video, we're going to learn about the input and output of YOLO models.