Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 1.03 KB

README.md

File metadata and controls

42 lines (32 loc) · 1.03 KB

GoogleVision

Integrates Google Vision features, including image labeling, face, logo, and landmark detection, optical character recognition (OCR), and detection of explicit content, into applications.

A framework to use Cloud Vision API by Google in Swift.

Installation

CocoaPods:

pod 'GoogleVision'

Manual:

Copy GoogleVision.swift to your project.

Initialization

First of all you have to generate API key to use Google Cloud services in the console. And then use the following code:

GoogleVision.init(apiKey: "")

Using

let gv = GoogleVision.init(apiKey: "")
let img = UIImage(named: "Image")
gv.run(image:img) { (text, err) in
    guard let text = text, err == nil else {
        print(err?.localizedDescription)
        return
    }

    print(text)
}

License

GoogleVision is available under the MIT license. See the LICENSE file for more info.