WEBVTT

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

00:00.760 --> 00:03.520
We created the detection result data class.

00:03.760 --> 00:09.200
Now let's create another interface here inside the data.

00:09.480 --> 00:14.520
And uh let me call it as detection listener.

00:14.720 --> 00:22.400
This interface acts as a callback mechanism for your TensorFlow object detection.

00:22.520 --> 00:29.880
This interface defines a contract for receiving detection results and errors asynchronously from your

00:29.880 --> 00:31.880
detection logic.

00:31.920 --> 00:41.720
We have two methods inside this interface that they are mandatory to be implemented on.

00:41.760 --> 00:47.800
Error takes an error of type, string, and function on results.

00:47.920 --> 00:57.560
Takes a list of immutable list of detection result list detection result that we created before the

00:57.800 --> 01:07.080
image height is of type integer, image width type integer and rotation type integer.

01:07.120 --> 01:12.980
The on error function called when an error occurs during detection.

01:13.020 --> 01:22.780
The parameter error is a descriptive error message use cases handle features like modal loading errors,

01:22.820 --> 01:27.580
processing errors, and etc. the on results.

01:27.740 --> 01:32.980
This is a new function inside the detection listener called.

01:32.980 --> 01:37.340
When the detection is successful and results are ready.

01:37.500 --> 01:45.180
The results lists a list of detected objects using your detection result data class that we created

01:45.180 --> 01:54.900
before, and the image height height of the processed image in pixels with image width, width of processed

01:54.900 --> 02:02.140
image in pixels and rotation image rotation information useful for camera orientation.

02:02.180 --> 02:11.380
Okay, so your detection class will call these methods and any class that implements this interface

02:11.380 --> 02:13.900
will receive the callbacks.
