Support Google MLKit Standalone SDKs


Describe the Feature
On June 3, 2020 Google released a standalone set of SDKs for ML. ML is currently part of firebase. new SDKs:

From the docs, sounds like firebase ML kit will eventually be deprecated, so in order to receive updates, consumers should update to the standalone MLKit SDKs.

One of the immediate benefits with the new SDK is that you can bundle ML models at build-time, so they can be specified at build-time and are available to the user after app install instead of downloaded over-the-air. I believe this is not possible with firebase ML

Possible Implementations
Google provides migration guides for android and ios:

Related Issues

Love react-native-camera? Please consider supporting our collective: 👉
Want this feature to be resolved faster? Please consider adding a bounty to it

2 thoughts on “Support Google MLKit Standalone SDKs

  1. Got started on this here (still very WIP) — davidgovea/pull/1
    Tried to separate the google migration steps into individual commits.

    Have not tested yet, and conditional imports on iOS have been disabled for the moment (I do not have a good understanding of “module style” @imports vs the usual #import)

    My goal is to add labeling & object detection as well. I think a strategy is needed to include/exclude individual components on android (iOS already has this via subspecs). Possibly project.hasProperty checks in the build.gradle dependencies.

  2. Made quite a bit of progress — will be putting up the real PR shortly.

    What’s done:

    • Refactor face/barcode/text detection to ML Kit on both platforms
    • Remove Firebase requirement (no google-services.json / GoogleServices.plist needed any more)
    • Add on-device Image labeling to library and example app

    The example is working well!

    What’s TODO:

    • Provide screenshots
    • Update documentation
      • iOS minimum target increased to 10
      • Notes on firebase removal
      • Migration notes
      • Image labeling notes (new subspec on iOS)
    • Modularity
      • Test including only some subspecs on iOS. Make sure conditional code blocks are working as intended
      • Consider Android modularity. Currently, it’s “all or nothing” for ML Kit. Since most models are packaged locally, it might be desirable to be able to pick&choose between Face/Barcode/Text/Labels. Could use some advice here.
    • Object tracking
      • The other new ML Kit feature. Could add the base model functionality
    • Custom models
      • Research how custom models are used & provide notes