EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 448 forks source link

Error MLKit Face detection - Android #1041

Open mrioso opened 5 years ago

mrioso commented 5 years ago

ML Kit error: Waiting for the face detection model to be downloaded. Please wait.

PD: Text recognition works fine

EddyVerbruggen commented 5 years ago

Wat happened after you've waited for the download? And is face detection enabled in your config?

MrCalamitus commented 5 years ago

Hello @EddyVerbruggen you made a great work with this plugin.

I have the face Dependency in my config. But sometimes I have the same problem, I think when first run time.

captura de pantalla 2019-01-14 a la s 16 11 42
EddyVerbruggen commented 5 years ago

Please share a repo which I can clone and inspect.

MrCalamitus commented 5 years ago

Hi @EddyVerbruggen. Ready! ... I invited you at my repo, you can clone from https://github.com/MrCalamitus/faceRecognition

tirsomartinezreyes commented 5 years ago

Hi @EddyVerbruggen and @MrCalamitus

To avoid the "Waiting for the face detection model to be downloaded. Please wait." infinite console log, you can add the face model as dependency into gradle (I did it on app.gradle):

dependencies {
    compile 'com.google.firebase:firebase-ml-vision-face-model:17.0.2'
}

I notice after install and select face and label features to be use, the plugin includes model for label , but don't includes face detection model.

image

image

tirsomartinezreyes commented 5 years ago

I think the face option is missing on

https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/12dc2e99df9ab269de0939aefd13f6d64b7875bb/src/scripts/postinstall.js#L4952

AklsKiu commented 5 years ago

Resolve: AndroidManifest.xml like this:

<application .....>
<meta-data
            android:name="com.google.firebase.ml.vision.DEPENDENCIES"
            android:value="ocr, face, label" />
</application>

and app.gradle like this:

dependencies {
  implementation 'com.google.firebase:firebase-ml-vision:18.0.1'
  implementation 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2'
  implementation 'com.google.firebase:firebase-ml-vision-face-model:17.0.2'
}