Welcome back.
After we created the output buffer let's run the inference and process the result.
So here run inference interpreter run run.
And here we need to pass two parameters the input and the block.
The input is the input buffer and the output is output buffer dot buffer dot rewind.
Here we started with the safe call operator that a question mark and the dot safely accesses the run
method only if the interpreter is not null.
If the interpreter is null, the entire expression returns null without throwing a null pointer exception.
So for this purpose we used the safe call operator.
Here we have two parameters.
The first parameter the input buffer.
The input buffer.
Here a buffer containing input data to be processed by the interpreter.
So let me write this note here and the second input and the second Parameter.
The output buffer that buffer accesses the underlying buffer and rewind resets the buffers position
to zero, preparing it for new data.
This ensures the interpreter writes output starting from the beginning of the buffer.
What does this code do?
This interpreter takes input from input buffer, processes it according to its logic, then writes the
results to the output buffer starting from position zero.
Due to the rewind method again guys, the interpreter takes the input buffer, process the data and
then write it back by using the output buffer starting from position zero.
Then we need to process the data.
So here and process the result process.
Results val results equal to parse classification output.
This method we're going to create in the next couple of minutes pass the output buffer and listener
dot on result.
We need also to create this that the results passed as Parameter bitmap dot height and bitmap dot width.
We need to pass four parameters.
Did you remember the listener that we created before?
And here we need to pass the rotation.
Let me create the catch close here.
Listener dot on error detection failed.
Create a log if there is any errors.
Okay so this for catching any errors here.
We're uh we're passing the results and storing it into a variable and passing it to the listener as
a first parameter, then passing the bitmap height, but bitmap width and rotation to the on results
function that it is from the detection listener.
So if we go back to the detection listener listener, let me show you.
We have here two functions on error and on results.
We created this in the previous videos.
So we need to pass four parameters results height, width and rotation.
Now let's create this function pass classification output.