WEBVTT

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

00:01.000 --> 00:06.960
After we created the output buffer let's run the inference and process the result.

00:06.960 --> 00:11.440
So here run inference interpreter run run.

00:11.440 --> 00:17.760
And here we need to pass two parameters the input and the block.

00:18.000 --> 00:27.640
The input is the input buffer and the output is output buffer dot buffer dot rewind.

00:27.680 --> 00:37.520
Here we started with the safe call operator that a question mark and the dot safely accesses the run

00:37.520 --> 00:41.640
method only if the interpreter is not null.

00:41.840 --> 00:50.120
If the interpreter is null, the entire expression returns null without throwing a null pointer exception.

00:50.120 --> 00:54.960
So for this purpose we used the safe call operator.

00:54.960 --> 00:57.760
Here we have two parameters.

00:57.960 --> 01:01.560
The first parameter the input buffer.

01:01.800 --> 01:02.680
The input buffer.

01:02.680 --> 01:09.160
Here a buffer containing input data to be processed by the interpreter.

01:09.360 --> 01:16.680
So let me write this note here and the second input and the second Parameter.

01:16.720 --> 01:25.440
The output buffer that buffer accesses the underlying buffer and rewind resets the buffers position

01:25.440 --> 01:28.240
to zero, preparing it for new data.

01:28.520 --> 01:36.000
This ensures the interpreter writes output starting from the beginning of the buffer.

01:36.040 --> 01:37.880
What does this code do?

01:38.160 --> 01:47.160
This interpreter takes input from input buffer, processes it according to its logic, then writes the

01:47.160 --> 01:50.880
results to the output buffer starting from position zero.

01:51.000 --> 01:57.800
Due to the rewind method again guys, the interpreter takes the input buffer, process the data and

01:57.800 --> 02:03.040
then write it back by using the output buffer starting from position zero.

02:03.080 --> 02:05.880
Then we need to process the data.

02:05.880 --> 02:08.760
So here and process the result process.

02:08.800 --> 02:16.800
Results val results equal to parse classification output.

02:16.840 --> 02:24.360
This method we're going to create in the next couple of minutes pass the output buffer and listener

02:24.480 --> 02:26.080
dot on result.

02:26.120 --> 02:36.970
We need also to create this that the results passed as Parameter bitmap dot height and bitmap dot width.

02:37.210 --> 02:39.530
We need to pass four parameters.

02:39.530 --> 02:42.210
Did you remember the listener that we created before?

02:42.370 --> 02:46.010
And here we need to pass the rotation.

02:46.010 --> 02:48.850
Let me create the catch close here.

02:48.890 --> 02:52.730
Listener dot on error detection failed.

02:52.770 --> 02:55.810
Create a log if there is any errors.

02:55.930 --> 02:59.770
Okay so this for catching any errors here.

03:00.010 --> 03:07.530
We're uh we're passing the results and storing it into a variable and passing it to the listener as

03:07.530 --> 03:14.530
a first parameter, then passing the bitmap height, but bitmap width and rotation to the on results

03:14.530 --> 03:18.010
function that it is from the detection listener.

03:18.250 --> 03:22.650
So if we go back to the detection listener listener, let me show you.

03:22.890 --> 03:27.210
We have here two functions on error and on results.

03:27.210 --> 03:29.450
We created this in the previous videos.

03:29.450 --> 03:35.290
So we need to pass four parameters results height, width and rotation.

03:35.290 --> 03:40.810
Now let's create this function pass classification output.
