# Google-Ml-Kit-plugin **Repository Path**: kikt/Google-Ml-Kit-plugin ## Basic Information - **Project Name**: Google-Ml-Kit-plugin - **Description**: The fork of https://github.com/bharat-biradar/Google-Ml-Kit-plugin - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-01-29 - **Last Updated**: 2023-01-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Google's ML Kit for Flutter Google's ML Kit for Flutter is a set of [Flutter plugins](https://flutter.io/platform-plugins/) that enable [Flutter](https://flutter.dev) apps to use [Google's standalone ML Kit](https://developers.google.com/ml-kit). ## Features ### Vision APIs | Feature | Plugin | Source Code| Android | iOS | |-----------------------------------------------------------------------------------------------|--------|------------|---------|-----| |[Barcode Scanning](https://developers.google.com/ml-kit/vision/barcode-scanning) | [google\_mlkit\_barcode\_scanning](https://pub.dev/packages/google_mlkit_barcode_scanning) [![Pub Version](https://img.shields.io/pub/v/google_mlkit_barcode_scanning)](https://pub.dev/packages/google_mlkit_barcode_scanning) | [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_mlkit_barcode_scanning) | ✅ | ✅ | |[Face Detection](https://developers.google.com/ml-kit/vision/face-detection) | [google\_mlkit\_face\_detection](https://pub.dev/packages/google_mlkit_face_detection) [![Pub Version](https://img.shields.io/pub/v/google_mlkit_face_detection)](https://pub.dev/packages/google_mlkit_face_detection) | [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_mlkit_face_detection) | ✅ | ✅ | |[Image Labeling](https://developers.google.com/ml-kit/vision/image-labeling) | [google\_mlkit\_image\_labeling](https://pub.dev/packages/google_mlkit_image_labeling) [![Pub Version](https://img.shields.io/pub/v/google_mlkit_image_labeling)](https://pub.dev/packages/google_mlkit_image_labeling) | [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_mlkit_image_labeling) | ✅ | ✅ | |[Object Detection and Tracking](https://developers.google.com/ml-kit/vision/object-detection) | [google\_mlkit\_object\_detection](https://pub.dev/packages/google_mlkit_object_detection) [![Pub Version](https://img.shields.io/pub/v/google_mlkit_object_detection)](https://pub.dev/packages/google_mlkit_object_detection) | [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_mlkit_object_detection) | ✅ | ✅ | |[Text Recognition](https://developers.google.com/ml-kit/vision/text-recognition) | [google\_mlkit\_text\_recognition](https://pub.dev/packages/google_mlkit_text_recognition) [![Pub Version](https://img.shields.io/pub/v/google_mlkit_text_recognition)](https://pub.dev/packages/google_mlkit_text_recognition) | [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_mlkit_text_recognition) | ✅ | ✅ | |[Text Recognition V2](https://developers.google.com/ml-kit/vision/text-recognition/v2) | [google\_mlkit\_text\_recognition](https://pub.dev/packages/google_mlkit_text_recognition) [![Pub Version](https://img.shields.io/pub/v/google_mlkit_text_recognition)](https://pub.dev/packages/google_mlkit_text_recognition) | [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_mlkit_text_recognition) | ✅ | ✅ | |[Digital Ink Recognition](https://developers.google.com/ml-kit/vision/digital-ink-recognition) | [google\_mlkit\_digital\_ink\_recognition](https://pub.dev/packages/google_mlkit_digital_ink_recognition) [![Pub Version](https://img.shields.io/pub/v/google_mlkit_digital_ink_recognition)](https://pub.dev/packages/google_mlkit_digital_ink_recognition) | [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_mlkit_digital_ink_recognition) | ✅ | ✅ | |[Pose Detection](https://developers.google.com/ml-kit/vision/pose-detection) | [google\_mlkit\_pose\_detection](https://pub.dev/packages/google_mlkit_pose_detection) [![Pub Version](https://img.shields.io/pub/v/google_mlkit_pose_detection)](https://pub.dev/packages/google_mlkit_pose_detection) | [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_mlkit_pose_detection) | ✅ | ✅ | |[Selfie Segmentation](https://developers.google.com/ml-kit/vision/selfie-segmentation) | [google\_mlkit\_selfie\_segmentation](https://pub.dev/packages/google_mlkit_selfie_segmentation) [![Pub Version](https://img.shields.io/pub/v/google_mlkit_selfie_segmentation)](https://pub.dev/packages/google_mlkit_selfie_segmentation) | [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_mlkit_selfie_segmentation) | ✅ | ✅ | ### Natural Language APIs | Feature | Plugin | Source Code| Android | iOS | |-----------------------------------------------------------------------------------------------|--------|------------|---------|-----| |[Language Identification](https://developers.google.com/ml-kit/language/identification) | [google\_mlkit\_language\_id](https://pub.dev/packages/google_mlkit_language_id) [![Pub Version](https://img.shields.io/pub/v/google_mlkit_language_id)](https://pub.dev/packages/google_mlkit_language_id) | [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_mlkit_language_id) | ✅ | ✅ | |[On-Device Translation](https://developers.google.com/ml-kit/language/translation) | [google\_mlkit\_translation](https://pub.dev/packages/google_mlkit_translation) [![Pub Version](https://img.shields.io/pub/v/google_mlkit_translation)](https://pub.dev/packages/google_mlkit_translation) | [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_mlkit_translation) | ✅ | ✅ | |[Smart Reply](https://developers.google.com/ml-kit/language/smart-reply) | [google\_mlkit\_smart\_reply](https://pub.dev/packages/google_mlkit_smart_reply) [![Pub Version](https://img.shields.io/pub/v/google_mlkit_smart_reply)](https://pub.dev/packages/google_mlkit_smart_reply) | [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_mlkit_smart_reply) | ✅ | ✅ | |[Entity Extraction](https://developers.google.com/ml-kit/language/entity-extraction) | [google\_mlkit\_entity\_extraction](https://pub.dev/packages/google_mlkit_entity_extraction) [![Pub Version](https://img.shields.io/pub/v/google_mlkit_entity_extraction)](https://pub.dev/packages/google_mlkit_entity_extraction) | [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_mlkit_entity_extraction) | ✅ | ✅ | ## Requirements ### iOS - Minimum iOS Deployment Target: 10.0 - Xcode 13 or newer - Swift 5 - ML Kit only supports 64-bit architectures (x86_64 and arm64). Check this [list](https://developer.apple.com/support/required-device-capabilities/) to see if your device has the required device capabilities. Since ML Kit does not support 32-bit architectures (i386 and armv7), you need to exclude armv7 architectures in Xcode in order to run `flutter build ios` or `flutter build ipa`. More info [here](https://developers.google.com/ml-kit/migration/ios). Go to Project > Runner > Building Settings > Excluded Architectures > Any SDK > armv7 ![](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/blob/master/resources/build_settings_01.png) Then your Podfile should look like this: ```ruby # add this line: $iOSVersion = '10.0' post_install do |installer| # add these lines: installer.pods_project.build_configurations.each do |config| config.build_settings["EXCLUDED_ARCHS[sdk=*]"] = "armv7" config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = $iOSVersion end installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) # add these lines: target.build_configurations.each do |config| if Gem::Version.new($iOSVersion) > Gem::Version.new(config.build_settings['IPHONEOS_DEPLOYMENT_TARGET']) config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = $iOSVersion end end end end ``` Notice that the minimum `IPHONEOS_DEPLOYMENT_TARGET` is 10.0, you can set it to something newer but not older. ### Android - minSdkVersion: 21 - targetSdkVersion: 31 - compileSdkVersion: 31 ## Migrating from ML Kit for Firebase When Migrating from ML Kit for Firebase read [this guide](https://developers.google.com/ml-kit/migration). For Android details read [this](https://developers.google.com/ml-kit/migration/android). For iOS details read [this](https://developers.google.com/ml-kit/migration/ios). ## Firebase dependency: Custom Models Google's standalone ML Kit library does have any direct dependency with Firebase. As designed by Google, you do not need to include Firebase in your project in order to use ML Kit. However, some ML Kit APIs have the possibility to be used with [Custom Models](https://developers.google.com/ml-kit/custom-models), that means that the default models can be replaced with custom TensorFlow Lite models. The plugins that allow Custom Models are: - [google\_mlkit\_image\_labeling](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_mlkit_image_labeling) - [google\_mlkit\_object\_detection](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_mlkit_object_detection) ### iOS Additional Setup To use custom models hosted in firebase in iOS, you have to update your app's Podfile. First, include `GoogleMLKit/LinkFirebase` and `Firebase` in your Podfile: ```ruby platform :ios, '10.0' ... # Enable firebase-hosted models # pod 'GoogleMLKit/LinkFirebase' pod 'Firebase' ``` Next, add the preprocessor flag to enable the firebase remote models at compile time. To do that, update your existing `build_configurations` loop in the `post_install` step with the following: ```ruby post_install do |installer| installer.pods_project.targets.each do |target| ... # Here are some configurations automatically generated by flutter target.build_configurations.each do |config| # Enable firebase-hosted ML models config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ '$(inherited)', 'MLKIT_FIREBASE_MODELS=1', ] end end end ``` To setup Firebase for your project check this links: - [Add Firebase to your Android project](https://firebase.google.com/docs/android/setup) - [Add Firebase to your iOS project](https://firebase.google.com/docs/ios/setup) Also please note that in latest [versions](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/blob/master/packages/google_ml_kit/CHANGELOG.md), [google\_ml\_kit](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_ml_kit) has become an umbrella plugin including all the plugin listed in [Features](#features). For that reason you will need to configure Firebase in your project if using [google\_ml\_kit](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_ml_kit). We recommend you start using the plugins listed in [Features](#features) rather than using [google\_ml\_kit](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_ml_kit), otherwise you will be including unnecessary dependencies in your project. ## Example app Find the example app [here](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/tree/master/packages/google_ml_kit/example). ## Contributing Contributions are welcome. In case of any problems look at [existing issues](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/issues), if you cannot find anything related to your problem then open an issue. Create an issue before opening a [pull request](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/pulls) for non trivial fixes. In case of trivial fixes open a [pull request](https://github.com/bharat-biradar/Google-Ml-Kit-plugin/pulls) directly.