OAID / TengineKit

TengineKit - Free, Fast, Easy, Real-Time Face Detection & Face Landmarks & Face Attributes & Hand Detection & Hand Landmarks & Body Detection & Body Landmarks & Iris Landmarks & Yolov5 SDK On Mobile.
Other
2.38k stars 318 forks source link

Optimizations, which can be applied for the improvement of the sample code! #30

Closed krsad closed 3 years ago

krsad commented 3 years ago

First of all, I really like the code and it works pretty fast. I downloaded the sample apk and install to my Android phone. It is super fast. However, when I compile the sample code, it has a little bit delay. Can you explain what kind of optimizations did you use, or if it is possible can you upload the source code of apk?

Crusoekid commented 3 years ago

use opengl to draw

krsad commented 3 years ago

Is it possible to detect only bigger faces to improve the performance?

Crusoekid commented 3 years ago

yes,little bigger

krsad commented 3 years ago

Does the SDK have an argument to adjust the box size for bigger images? For example, start with 3x3 boxes or 15x15 boxes, while searching the face. If it has, can you explain with an example code?

Crusoekid commented 3 years ago

you can use GoDetect ,have a try?

krsad commented 3 years ago

After a lot of search on different things, I found what is wrong with the sample code. Sample code works with 10-14 fps on my Samsung Galaxy A50, however the demo apk works so fluent(I cannot see the fps on demo). After I removed the CameraActivity.java -> onPreviewFrame -> two runnable function ( just the runnable part, the code inside the scopes must stay), I finally get 20-22 fps. It is a huge improvement. I suggest that on the sample code, the runnable parts must be removed.

Crusoekid commented 3 years ago

Thank you for your suggestion. I will modify it in the sample code. But I have a question, what sample do you run with only 10-14pfs?

krsad commented 3 years ago

I am working on FaceDemo. Actually most of the codes were slow, as far as remember. Also I have another question. Is it possible to increase the window size of the model, because I need only the closest person to the phone, I am not interested with other people. And even if it is possible, can you describe how, in detail?

Crusoekid commented 3 years ago

I've modified the code for sample. You can judge according to the size of the returned face. Because the algorithm does not have the parameters that are far from the camera.

krsad commented 3 years ago

After the update, there is an error, when I want to go back from face detection part to main page. I couldn't understand what is wrong, but it might be related to thread usage. Can you check that?