Welcome back.
Now let's talk about the input and output shapes of our model.
We have YOLO input Float32 one 640 640 and three.
This defines what kind of image you need to feed into the model.
Float32 is the data type.
The pixel values should be 32 bit floating point numbers.
This is usually means your image pixels need to be normalized.
Example scaled from 0 to 255.
We need to normalize them from 0 to 1.
Now let's talk about the array or the tensor.
The shape or dimensions of the expected data array.
It's read as batch size height.
Width channels.
First of all, the batch size number one here means That this is the batch size.
This is or this model is configured to process one image at a time.
640 and 640 is the height and the width of the image in pixels.
Three the channels.
The three color channels red, green and blue RGB.
In simple terms, you must preprocess your input image to be 640 by 640 pixel RGB image, normalized
to Float32 values and submitted as a batch of one.
Now let's talk about the output tensor.
This is the raw, unprocessed output of the YOLO model.
It contains all the potential directions and needs to be parsed to be useful.
Float32.
The data type of the output values one, five and 808,400.
The shape.
This is the most complex part.
It's best understood as batch size data per detection and total possible detections.
Let's start with the batch size corresponds to one image we fed in and one image at a time.
Five data per detection.
This is the crucial part for each of the 8000 808,400 potential directions.
The model outputs five values.
The composition of these five values depends on the number of classes your model was trained to detect.
8400 the total possible detections.
This is the number of the anchor boxes or potential object locations.
The model checks YOLO divides the image into a grid, and the checks for objects at each cell at different
scales.
For a modern YOLO version eight model, this number is typically 80 times 80 plus, 40 times 40 plus
20 times 20 equals to 8400.
And this is the total possible detections.
The most important part is number five.
We have the most common structure of these five values.
We have center x.
We talked about it.
And center y center y.
This is the second value.
The third value is the height and the fourth value is the object Objectness uh score.
And the fifth value is the class score.
We're going to work with those values and data per detection in the Android studio.
So don't worry.
The x and y center x and y, the coordinates of the center of the detected bounding box width and height.
Um, the dimensions of the detected bounding box and the object.
Objective object score the model's confidence that this box contains any object at all.
That's all.
And that's for values with only one value left.
It must be the class probability for that single class.
There is no need for multiple class scores.
Okay, so, uh, in short, your model takes a 640 by 640 image and outputs 8400 candidate boxes for
a single object class, which you must then filter and clean up to get the final useful detections.
Okay.
This is what we're going to work with in Android.