Welcome back.
We created the detection result data class.
Now let's create another interface here inside the data.
And uh let me call it as detection listener.
This interface acts as a callback mechanism for your TensorFlow object detection.
This interface defines a contract for receiving detection results and errors asynchronously from your
detection logic.
We have two methods inside this interface that they are mandatory to be implemented on.
Error takes an error of type, string, and function on results.
Takes a list of immutable list of detection result list detection result that we created before the
image height is of type integer, image width type integer and rotation type integer.
The on error function called when an error occurs during detection.
The parameter error is a descriptive error message use cases handle features like modal loading errors,
processing errors, and etc. the on results.
This is a new function inside the detection listener called.
When the detection is successful and results are ready.
The results lists a list of detected objects using your detection result data class that we created
before, and the image height height of the processed image in pixels with image width, width of processed
image in pixels and rotation image rotation information useful for camera orientation.
Okay, so your detection class will call these methods and any class that implements this interface
will receive the callbacks.