Closed wilav-dev closed 2 years ago
Indeed, all of the on-device ML APIs were removed from firebase quite some time ago, leaving us with nothing except custom model downloading in the native SDKs, and those are not exposed at the moment, for lack of interest in general:
https://rnfirebase.io/ml/usage#usage
Current no public APIs
The last version that supported them was version 11.5.0 here: https://github.com/invertase/react-native-firebase/blob/main/CHANGELOG.md#breaking-changes-2 (which is not recommended, but just indicates when they were removed - I suppose you could try it)
The on-device ML features in general have moved to MLKit native SDKs from google. We (Invertase) had/have some plans to extract the MLKit APIs to their own package similar to what we did with the Admob APIs removed from firebase, which we now maintain as https://github.com/invertase/react-native-google-mobile-ads - but we have not done that as of yet, again mostly for lack of apparent interest (with apologies to those that are interested - we are aware there some)
In the meantime, perhaps this would work? https://github.com/agoldis/react-native-mlkit-ocr
I found this library which has many features https://github.com/a7med-mahmoud/react-native-ml-kit
Issue
I'm trying to use ml barcodeDetectorProcessImage, faceDetectorProcessImage and cloudDocumentTextRecognizerProcessImage. I was not able to find examples in the documentation. I'm getting the following error
[TypeError: (0, _ml.default)().cloudDocumentTextRecognizerProcessImage is not a function. (In '(0, _ml.default)().cloudDocumentTextRecognizerProcessImage(imagePath)', '(0, _ml.default)().cloudDocumentTextRecognizerProcessImage' is undefined)]
I enabled 3 models in firebase.json and Vision API in Google Cloud.
package.json
:firebase.json
for react-native-firebase v6: