Giter Site home page Giter Site logo

madhavtripathi05 / ml_kit_ocr Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 86 KB

ML Kit OCR plugin for Android and iOS

Home Page: https://pub.dev/packages/ml_kit_ocr

License: MIT License

Kotlin 21.75% Ruby 6.36% Swift 1.07% Objective-C 35.06% Dart 35.77%

ml_kit_ocr's Introduction

MLKit OCR

Plugin which provides native ML Kit OCR APIs

Requirements

Android

  • Set minSdkVersion 21 in android/app/build.gradle
  • Set ext.kotlin_version = '1.6.10' in android/build.gradle
  • Add <meta-data android:name="com.google.mlkit.vision.DEPENDENCIES" android:value="ocr" /> in android/src/main/AndroidManifest.xml
  • Note: In case you are using multiple models separate them with commas android:value="ocr,ica"
  • App size impact: 260KB, 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
  • App size impact: About 20 MB, refer here

Usage

// Create an Instance of [MlKitOcr]
final ocr = MlKitOcr();

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

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

// Iterate over TextBlocks 
for (var blocks in result.blocks) {
    for (var lines in blocks.lines) {
        for (var words in lines.elements) {
            recognitions += words.text;
        }
    }
}

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_ocr's People

Contributors

madhavtripathi05 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.