WEBVTT

00:00.120 --> 00:02.600
We finished analyze function.

00:02.600 --> 00:06.080
Now let's create the detect function.

00:06.080 --> 00:16.200
Under this function create private function detect image proxy which is of type image proxy from Android

00:16.200 --> 00:23.400
X camera and returning type is a list of detection object.

00:23.440 --> 00:26.560
Okay, so here we have three steps.

00:26.720 --> 00:38.640
The first step is converting image proxy to properly formatted TensorFlow image with unassigned or unsigned

00:38.680 --> 00:40.880
integer data type.

00:41.080 --> 00:46.800
So start with val tensor image equals to load image.

00:46.800 --> 00:54.600
Or we can create another uh another function which is prepare image for model.

00:54.600 --> 00:57.920
So prepare image for model.

00:57.960 --> 01:00.880
Passing the image proxy okay.

01:01.080 --> 01:08.760
This is the first step converting image proxy to properly formatted TensorFlow image with uh unsigned

01:08.840 --> 01:10.970
integer eight type.

01:11.010 --> 01:17.890
Then we need to run inference with unassigned integer eight.

01:17.930 --> 01:28.610
Interpreter run for multiple inputs outputs and send it as an array of TensorFlow image dot buffer.

01:28.810 --> 01:31.970
This is the input and this is the output.

01:32.290 --> 01:37.810
The input array of TensorFlow image dot buffer that it is prepared.

01:37.810 --> 01:46.090
And we pass the image proxy and the output map that we created before above.

01:46.130 --> 01:46.610
Okay.

01:46.770 --> 01:48.930
So this is the output map.

01:49.210 --> 01:54.210
And the input is an array of TensorFlow image dot buffer.

01:54.410 --> 01:59.010
The returning type is pass detection result.

01:59.010 --> 02:07.330
So return pass detection results function go and call pass detection result.

02:07.330 --> 02:10.650
So we need to create another two functions.

02:10.650 --> 02:17.050
And the last two functions prepare image for model and pass detection result.
