googlesamples / mlkit

A collection of sample apps to demonstrate how to use Google's ML Kit APIs on Android and iOS
Apache License 2.0
3.51k stars 2.92k forks source link

Arcore face crash #54

Closed wkl-coder closed 4 years ago

wkl-coder commented 5 years ago

Step 1: Describe your environment

Step 2: Describe the problem:

Steps to reproduce:

Arcore facial recognition tracking, flashback

Observed Results:

Process: com.google.ar.sceneform.samples.augmentedfaces, PID: 11199 java.lang.IllegalArgumentException: Invalid image data size. at com.google.android.gms.vision.Frame$Builder.setImageData(Unknown Source:13) at com.google.firebase.ml.vision.common.FirebaseVisionImage.zza(Unknown Source:137) at com.google.firebase.ml.vision.face.FirebaseVisionFaceDetector.detectInImage(Unknown Source:26) at com.google.ar.sceneform.samples.augmentedfaces.AugmentedFacesActivity.lambda$onCreate$1(AugmentedFacesActivity.java:180)

Expected Results:

Be able to identify, do not crash back

Relevant Code:

image

samtstern commented 5 years ago

Hmm the key here seems to be this call:

java.lang.IllegalArgumentException: Invalid image data size.
calren commented 4 years ago

Yeah, like Sam said, it seems like the image passed in isn't what the method is expecting. I would look into the parameters the app is setting for getting camera preview frames. This documentation page also has more information about the different image formats the method can take.

I'm going to go ahead and close this issue since it hasn't had any activity for a while, but feel free to reopen and continue the discussion if you're still seeing the same issue.