We finished analyze function.
Now let's create the detect function.
Under this function create private function detect image proxy which is of type image proxy from Android
X camera and returning type is a list of detection object.
Okay, so here we have three steps.
The first step is converting image proxy to properly formatted TensorFlow image with unassigned or unsigned
integer data type.
So start with val tensor image equals to load image.
Or we can create another uh another function which is prepare image for model.
So prepare image for model.
Passing the image proxy okay.
This is the first step converting image proxy to properly formatted TensorFlow image with uh unsigned
integer eight type.
Then we need to run inference with unassigned integer eight.
Interpreter run for multiple inputs outputs and send it as an array of TensorFlow image dot buffer.
This is the input and this is the output.
The input array of TensorFlow image dot buffer that it is prepared.
And we pass the image proxy and the output map that we created before above.
Okay.
So this is the output map.
And the input is an array of TensorFlow image dot buffer.
The returning type is pass detection result.
So return pass detection results function go and call pass detection result.
So we need to create another two functions.
And the last two functions prepare image for model and pass detection result.