shubham0204 / Age-Gender_Estimation_TF-Android

Age + Gender Estimation on Android with TensorFlow Lite
https://equipintelligence.medium.com/detecting-age-and-gender-with-tf-lite-on-android-33997eed6c25
MIT License
57 stars 14 forks source link

Manage TFlite and MediaPipe for different ABIs #3

Open VishV-Android opened 3 months ago

VishV-Android commented 3 months ago

I am creating an android app using TensorFlow and MediaPipe for Object Detection. But in some devices, I am getting ABIs crashes for some devices in the firebase and this problem I am facing after the release the app. Could you pls help to resolve this issue? Thanks in advance.

shubham0204 commented 3 months ago

TFLite and Mediapipe APIs are compiled for four ABI platforms, armeabi-v7a, arm64-v8a, x86 and x86-64 which cover most Android devices. Could you tell specifically, on which ABIs is the app crashing?

VishV-Android commented 3 months ago

@shubham0204 I am getting crashes issues in the app production.

I am asking about is it necessary to use these abiFilters for supports 32-bit processor?

ndk { abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64' ,'x86' }

check this and also you can check the stackTrace as well at the bottom.

Screenshot 2024-05-20 175114

shubham0204 commented 3 months ago

MLKit and TFLite docs do not suggest adding abiFilters to build.gradle, but there's no harm in adding them. Without adding them, Android / PlayStore assumes that the app is built for all four ABIs. If this is not the case with the app, users may face crashes as the native code will not be supported on their device. Hence, it would be great to add abiFilters to give the right directions to the Android OS and PlayStore

VishV-Android commented 3 months ago

I have added abiFilters but still getting error of not found native code. How to manage this? And if user face crashes then how to handle it?

shubham0204 commented 3 months ago

Can you share the entire log trace here (of the native-code not found error)?

VishV-Android commented 3 months ago

Here is the screenshot of play Console log trace.

Screenshot 2024-05-21 172333
VishV-Android commented 3 months ago

@shubham0204 did you checked this issue?

shubham0204 commented 3 months ago

I am still not able to understand the cause of the issue The best we can try is to update the TensorFlow dependencies if they're not the latest ones

VishV-Android commented 3 months ago

Whenever you figured out this issue Kindly let me know. In addition, I have used latest TensorFlow dependencies for my project.

shubham0204 commented 1 week ago

@VishV-Android Which Mediapipe Task library are you using for object detection? Do let me know its version and artifact ID.