-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Facedetection Static Bitmap image - Internal error occurred while executing MLKit tasks - Android #345
Comments
Here is another useful information: If I try to do this with URI, it works fine. But bitmap is causing internal error. This might be a useful tip as well. I was following the documentation step by step but I accidentally included both google play services module and the bundle module and built the gradle. Then I deleted the google plays services module as I need the model to be bundled to the app. |
From the log, the face engine is initialized successfully, so I'm wondering if there's something wrong with the input bitmap. Can you check if the bitmap is valid before feeding to ML Kit? |
Bitmap is ok. I upload to firebase storage as bitmap data and I’m able to get the url and set an image so I guess it’s fine. |
Hi,
Could you print out the cause of this MlKitException as well? It'd be easier to check what failed if we have the full details. Thanks! |
@SilverDestiny Can you give me instructions on how I can get that for you? Sorry kind of new to android |
MlKitException was constructed by the error message and cause Throwable by https://developer.android.com/reference/java/lang/Exception#Exception(java.lang.String,%20java.lang.Throwable) From your code:
I think the |
Hey have you fixed the issue? Can we close this? |
Yes you can go ahead. Since our dev time was getting affected we ended up
using URL. Like I said, works fine with url but bitmap was not working. You
can try recreating by picking an image using image picker and supply that
image to see if a face is detected. As you know, image picker gives us the
bitmap. I was able to upload the bitmap to firebase, retrieve its url and
load up the image using coil etc so data was not corrupted. Maybe you can
try replicating this on your end. Sorry couldn’t assist further
…On Wed, 29 Sep 2021 at 20:58, jackqdyulei ***@***.***> wrote:
Hey have you fixed the issue? Can we close this?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#345 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANSS4VQVSPVDZ4RC4KTGBB3UEMWARANCNFSM5CUOAYCA>
.
|
Hey could you at least give us following information?
|
Sure,
1. SDK ‘com.google.mlkit:face-detection:16.1.2’
SDK ‘com.google.mlkit:barcode-scanning:17.0.0’
2. We are supporting devices that are only android 8.1 and above. Nothing
less than that
3. Phone used to test the feature real device - Vivo 1906 - android version
11. Did not test this on other devices as we are limited on phone supply.
Let me know if you need any other information
…On Wed, 29 Sep 2021 at 21:34, jackqdyulei ***@***.***> wrote:
Hey could you at least give us following information?
1.
SDK version
com.google.mlkit:face-detection:
2.
The Device API level where it breaks. (Since you added @RequiresAPI
and have special code on API level < 28 )
1.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#345 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANSS4VTTB3KKFSQNOPUAAI3UEM2HJANCNFSM5CUOAYCA>
.
|
Thanks for your report. The root cause is We will consider whether to support it, or explicitly mention it in javadoc. |
Ok, thank you.
…On Wed, 6 Oct 2021 at 23:49, jackqdyulei ***@***.***> wrote:
Thanks for your report. The root cause is
ImageDecoder.decodeBitmap(source) by default returns HARDWARE bitmap,
which is not support by ML Kit.
We will consider whether to support it, or explicitly mention it in
javadoc.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#345 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANSS4VWWYVQEHR3XZVVPY63UFSHL7ANCNFSM5CUOAYCA>
.
|
Issue been fixed internally and will be available in future release. |
So I am following Jetpack architecture and MVVM pattern. In the fragment, I use the image picker to fetch an image . If the user has successfully picked an image, then I call an isFaceDetected function from the viewModel. Here is the function:
Here is how I call this function from the fragment
I have followed all steps in documentation. I am using bundled model. I am getting error Internal error occurred while executing MLKit tasks. Here is the trace from logs
The text was updated successfully, but these errors were encountered: