question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] ML Kit: On-Device Model Download API

See original GitHub issue

I’d like to request an API to query the download status for MLKit’s on-device models. Ideally, this API would allow the following:

  1. return the current status of the on-device model for a given “kit” (e.g., barcode, face, etc.). Potential responses could be UNAVAILABLE, AVAILABLE, DOWNLOADING, etc.
  2. initiate a download for a specified “kit” and ideally allow an observer to be attached to monitor completion (e.g., Task<Void)
  3. (optional) delete a downloaded model

Here’s the current documentation with regards to on-device models:

Optional but recommended: Configure your app to automatically download the ML model to the device after your app is installed from the Play Store. To do so, add the following declaration to your app’s AndroidManifest.xml file:

<application ...>
 ...
 <meta-data
     android:name="com.google.firebase.ml.vision.DEPENDENCIES"
     android:value="barcode" />
 <!-- To use multiple models: android:value="barcode,model2,model3" -->
</application>

If you do not enable install-time model downloads, the model will be downloaded the first time you run the detector. Requests you make before the download has completed will produce no results.

(from https://firebase.google.com/docs/ml-kit/android/read-barcodes, emphasis mine)

I think it’s crucial to have APIs to monitor the state of the on-device models, especially since the system makes no guarantees about when the “runtime” download will start/finish.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:18
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

35reactions
p30arenacommented, Apr 18, 2019

We need an offline model bundled with the app for users with no network access.

13reactions
vlafourcadecommented, Dec 4, 2019

Another reason to have an embedded model is because some users download apps from different app stores (e.g. HiMarket, Samsung, Tencent, etc.) and in most cases don’t have the Google Play Services installed. So I’d like to reinforce the necessity to have an embedded model (it may be a lightweight version, just to have the feature working properly) to avoid this kind of issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ML Kit | Google Developers
ML Kit is a mobile SDK that brings Google's on-device machine learning expertise to Android and iOS apps. Use our powerful yet easy...
Read more >
ML Kit for Firebase - Google
ML Kit is a mobile SDK that brings Google's machine learning expertise to Android and iOS apps in a powerful yet easy-to-use package....
Read more >
Getting the best of on-device ML with ML Kit (Android Dev ...
This talk shows how developers can get the best out of ML Kit, providing various tips of using the APIs. It covers the...
Read more >
A Look at Android ML Kit - the Machine Learning SDK - Auth0
Requests made before the download is complete won't produce any results. To use multiple models, include them in a comma-separated list, e.g. ...
Read more >
Exploring the new ML Kit features on iOS using Swift - Heartbeat
Through this SDK, Google was hoping to help mobile developers bring machine learning to their apps with simple, concise code. As part of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found