Giter Site home page Giter Site logo

ml_kit_image_labeler's Introduction

MLKIT Image Labeler

Plugin which provides native ML Kit ImageLabeler API

Requirements

Android

  • Set minSdkVersion 21 in android/app/build.gradle

  • Add <meta-data android:name="com.google.mlkit.vision.DEPENDENCIES" android:value="ica" /> in android/src/main/AndroidManifest.xml

  • Note: In case you are using multiple models separate them with commas android:value="ica,ocr"

  • Set ext.kotlin_version = '1.6.10' in android/build.gradle

  • App size impact: 700KB(Using Unbundled Model, downloads model using Google play services for the first time when app launches), refer here

iOS

  • Minimum iOS Deployment Target: 10.0
  • Xcode 12.5.1 or greater.
  • ML Kit only supports 64-bit architectures (x86_64 and arm64). Check this list to see if your device has the required device capabilities.
  • Since ML Kit does not support 32-bit architectures (i386 and armv7) Read more, you need to exclude amrv7 architectures in Xcode in order to build iOS, refer here

Usage

// Create an Instance of [MlKitImageLabeler]
final imageLabeler = MlKitImageLabeler();


//...
// Pick Image using image picker
//...

// Call `processImage()` and pass params as `InputImage` [check example for more info]
final labels = await imageLabeler.processImage(
    InputImage.fromFilePath(image.path));

String predictedLabels = '';

// Iterate over Labels 
for (var label in labels) {
    predictedLabels +=
        '\n${label.label} ${(label.confidence * 100).toStringAsPrecision(2)}%';
}

This plugin is basically a trimmed down version of google_ml_kit. As google_ml_kit contains all the NLP and Vison APIs, the App size increases drastically. So, I created this plugin and now the example app's fat apk is of 17MB and splitted apks are 6MB.

ml_kit_image_labeler's People

Contributors

madhavtripathi05 avatar

Watchers

Tatsuya Kamada avatar  avatar

Forkers

agedash999

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.