Welcome back.
In order to save time, we're going to update the codes of the previous section.
So I created this project Object Detection SSD app in the previous section.
Go and open it in order to update some codes and add the model to the ML package and run it.
Okay.
It's similar to what we've done before, but we need to change and the codes according to the model
shapes.
Okay.
So the manifest we should create the the permission of the camera.
Also you can create your own um, and new uh, project.
Uh, but you should include the, those codes, the permissions for the manifest inside Gradle we should
include TensorFlow.
We should include Camerax permission and hilt.
We talked about hilt in the previous sections and in the previous videos.
So we need to add those, um, those plugins and also add the project level.
We should add those okay.
So those are the permissions and the libraries needed to work with our application.
Now delete this ML package and delete the Coco data set.
Now let's add a new model that we created.
Before.
Go to the downloads, copy the best Float16 the Tflite to the ML and here we go.
Now create a new file, name it as labels dot txt.
Inside this label we need to add the object classes.
So all the classes that you annotate in Roboflow you should add it here.
Okay, we have only one.
Um, we have only one class which is the battery.
So if you remember, the class is named battery and you should write it exactly as you specified in
Roboflow and in your, um, in your data set.
Okay.
So this is the labels dot txt and this is the best Float16 Tflite this those are the three steps we've
done before the manifest, the Build.gradle and the best Float16 Tflite and labels.
Now let's start examine every uh, every class.
So here the response inside the util we have this class.
It's, uh, we don't need to make anything uh, any update to it.
We have loading success and failure as we told the talked about it in the previous videos, this class
represents the possible states of a synchronous operation or API response out of T.
This is the type T indicates that that type parameter t is covenant.
You can use response of dog where response animal is expected.
So this is can be this can be uh like understood in this way response of dog where response animal is
expected.
Okay.
So this is the type T detection object.
We have this detection objects as uh similar to what we've done before.
It's a data class contains the score label and the bounding box.
The detection parameters also similar to what we've done before.
So those three classes, we don't need to make any change inside them.
Also I'll skip the object detector for now.
Camera permission wrapper.
There's nothing to do with this file.
Camera preview.
I'll skip it for later.
Uh, edit the detection screen.
No need to do anything.
Of course the detection view model we're going to update it.
The detection app.
No need to uh to do anything any update.
The main activity.
No need to do anything.
So we're going to update the detection view model.
We're going to update the object detector.
And if there is any error we're going to update the corresponding files.
But for now we uh added the permission.
We added that Gradle libraries and the model best Float16 Tflite.
And the label and those classes are similar.
The response detection, object detection parameter, camera permission wrapper, camera preview, the
drill boxes, detection app and main activity.
We're going to update the object detector detection screen and detection view model.