5

I'm using the MLKit Face Detection SDK for Android to detect the contours of a user's face.

When following this guide (https://developers.google.com/ml-kit/vision/face-detection/android), it shows how developers can (1) bundle the face detection model files within the compiled apk, or (2) download the face detection model files at runtime from Google Play Services.

I'm trying to run this SDK on various embedded devices. Of all of these devices, if I use option (1), the SDK works perfectly. If I use option (2), on some of my devices, the face detection models never get downloaded.

When I use option (1) and compile my apk, I see that MLKit bundles a folder called "models" inside of the assets directory of my apk file. The "models" folder contains the following .tflite, .tfl, .emd, and .pb files:

enter image description here

All of that prelude leading up to my actual question: If I deploy these files to a device myself (at the time when I provision the device, or through my own download mechanism), can I instruct the SDK where to look for them? Or can I upload these files to Firebase as custom models so I can control the download myself (if I upload these files to Firebase as custom models, which files do I need to upload -- all of them?)

Just to be clear: although I can use option (1) above and it works, I'm trying to keep our apk file as small as possible, and excluding the model files reduces my apk size by ~16 MB.

Thank you!

Luke
  • 2,187
  • 1
  • 18
  • 29
  • "On some of my devices, the face detection models never get downloaded", do these devices have Google Play Services? If yes, please file a bug under: https://issuetracker.google.com/issues/new?component=897785&template=1457144 with code snippets and bugreports. – Hoi Jul 15 '20 at 16:42
  • Also need to know this. If possible to download these models at runtime. – B200011011 Nov 29 '20 at 11:41
  • We do not support the self-served model downloading in ML Kit. We are working to improve the model downloading quality with Google Play Service. – Shiyu Jan 20 '21 at 18:30

0 Answers0