Closed archidvignesh closed 2 years ago
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,
2021-08-23 17:21:24.424 464-464/com.example.chemisstry D/Authentication: com.google.mlkit.common.MlKitException: Internal error has occurred when executing ML Kit tasks
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:
val result = detector.process(inputImage).addOnFailureListener {
Log.d("Authentication", it.toString())
}
I think the toString()
here only prints the top level error message without underlying cause details.
Probably you can log with Throwable https://developer.android.com/reference/android/util/Log#d(java.lang.String,%20java.lang.String,%20java.lang.Throwable) or just printStackTrace() https://developer.android.com/reference/java/lang/Throwable#printStackTrace()
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 https://github.com/googlesamples/mlkit/issues/345#issuecomment-930285652, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANSS4VQVSPVDZ4RC4KTGBB3UEMWARANCNFSM5CUOAYCA .
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 )
Sure,
SDK ‘com.google.mlkit:face-detection:16.1.2’ SDK ‘com.google.mlkit:barcode-scanning:17.0.0’
We are supporting devices that are only android 8.1 and above. Nothing less than that
Phone used to test the feature real device - Vivo 1906 - android version
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 https://github.com/googlesamples/mlkit/issues/345#issuecomment-930316655, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANSS4VTTB3KKFSQNOPUAAI3UEM2HJANCNFSM5CUOAYCA .
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.
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 https://github.com/googlesamples/mlkit/issues/345#issuecomment-936837995, 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