Implements ML Kit as Cordova plugin on iOS and Android.
Run:
npm i cordova-ml-kit
At the moment only Text Recognition and Labeling Images on Android is supported! This plugin requires cordova-plugin-firebase
!
Feature | Android | Android (Cloud) | iOS | iOS (Cloud) |
---|---|---|---|---|
Text recognition | [x] | [x] | [ ] | [ ] |
Face detection | [ ] | [ ] | ||
Barcode scanning | [ ] | [ ] | ||
Image labeling | [x] | [x] | [ ] | [ ] |
Landmark recognition | [ ] | [ ] | ||
Custom model inference | [ ] | [ ] |
Some features of ML Kit are only available on device others only on cloud. Please see https://firebase.google.com/docs/ml-kit/ for more information!
Text recognition on device
Text recognition on Cloud - Much better results, but you need an active paid plan (Blaze Plan) and activate it on Google Cloud. Parameter are the same like getText
Image Labeling on device
Image Labeling on Cloud
window["MlKitPlugin"].getText(fileBuffer, {},
(success) => {
console.log("getText success", success);
},
(error) => {
console.log("getText error", error);
});