WEBVTT

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

00:01.000 --> 00:04.760
We talked about the output shapes.

00:04.960 --> 00:14.880
Now let's understand how to connect and bridge between the model inference engine and your output arrays.

00:15.120 --> 00:21.760
This is a very common pattern in TensorFlow Lite and other mobile inference frameworks.

00:21.880 --> 00:27.320
So I want from you to focus with me to understand the map.

00:27.360 --> 00:37.880
The output map start with private val output map equals to mutable map of.

00:38.120 --> 00:45.880
Here we have an integer and any from Kotlin and use the apply function.

00:45.880 --> 00:49.880
And I'm gonna use the SSD mobile.

00:49.880 --> 00:53.480
Net typical output order.

00:53.520 --> 01:04.750
Put zero for output locations, one for output classes, two for output scores and three for output.

01:05.350 --> 01:06.790
Some detections.

01:06.990 --> 01:15.790
The output map tells the model interpreter where to write the output tensors after inference.

01:15.830 --> 01:22.830
Each integer key corresponds to a specific output tensor from your model.

01:22.870 --> 01:30.870
The output map is a bridge between the model inference engine and your output arrays.

01:31.110 --> 01:39.190
This is a common pattern in TensorFlow Lite and other mobile inference frameworks like YOLO.

01:39.790 --> 01:49.950
Okay, the first line here represents the bounding boxes 110 and for the second one is output classes.

01:50.150 --> 01:53.270
The class labels from one, one and ten.

01:53.430 --> 01:58.510
The third line put two the output scores.

01:58.550 --> 02:06.350
The confidence score 110 and put three output detection number.

02:06.390 --> 02:09.670
Number of detections and set it to one.

02:09.830 --> 02:13.550
Why this pattern is used for memory efficiency.

02:13.710 --> 02:17.110
Preallocate the arrays once.

02:17.150 --> 02:19.590
Reuse for every inference.

02:19.750 --> 02:23.830
Avoid garbage collection from creating new arrays constantly.

02:23.990 --> 02:30.950
Direct performance and direct memory mapping between model and your arrays.

02:30.990 --> 02:34.870
No copying your conversion overhead.

02:34.910 --> 02:40.070
Also, this pattern works with TensorFlow Lite.

02:40.150 --> 02:43.030
Run for multiple inputs outputs.

02:43.190 --> 02:50.790
Compatible with Android's and and and API and other mobile inference engines.

02:50.950 --> 02:54.110
Okay so this is a very important pattern.

02:54.350 --> 02:58.310
You should know in order to get the output map.

02:58.390 --> 03:04.180
So this pattern is used to handle object detection outputs on mobile devices.

03:04.220 --> 03:09.740
Now, outside this output map we need to update the params.

03:09.740 --> 03:17.460
So a new function here called update params and this function used.

03:17.580 --> 03:21.740
This params equals to params.

03:21.900 --> 03:24.660
This function takes params.

03:24.820 --> 03:28.180
It's of type detection parameters.

03:28.220 --> 03:37.620
Okay, this function is a configuration method that allows dynamic updating of detection parameters

03:37.660 --> 03:38.900
at runtime.

03:39.020 --> 03:49.020
This function enables real time adjustment of your object detectors behavior without recreating the

03:49.020 --> 03:51.660
entire detector instance.

03:51.700 --> 03:54.300
Okay, so this is a very important note.

03:54.420 --> 03:57.100
You should pay attention to it.
