google-vision-ocr

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2016 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

google-vision-ocr

Search image file and extract OCR text using Google Cloud Vision API

Installation

Install google-vision-ocr and required packages using go get command:

$ go get github.com/evalphobia/google-vision-ocr/...

Setting

Setup Cloud Vision API

Enable billing and API. Then create credential and save JSON file.

Set credential

set env parameter,

export GOOGLE_APPLICATION_CREDENTIALS=$HOME/.google/iam_service_credential.json

Usage

root command

$ google-vision-ocr
Commands:

  help      show help
  prepare   Create csv list file from --output dir
  ocr       Call Goole Cloud Vision API and get OCR result

prepare command

$ google-vision-ocr help prepare
Create csv list file from --output dir

Options:

  -h, --help                    display help information
  -i, --input                  *image dir path --input='/path/to/image_dir'
  -o, --output[=./output.csv]  *output TSV file path --output='./output.csv'
  -t, --type[=jpg,png,gif]      comma separate file extensions --type='jpg,png,gif'
$ google-vision-ocr prepare -i ./Pictures/ -o ./output.csv

$ cat ./output.csv
./Pictures/1.png
./Pictures/2.png

ocr command

$ google-vision-ocr help ocr
Call Goole Cloud Vision API and get OCR result

Options:

  -h, --help           display help information
  -f, --file          *image list file --file='/path/to/dir/output.tsv'
  -p, --parallel[=2]   parallel number --parallel=2
$ cat ./output.csv
./Pictures/1.png
./Pictures/2.png

$ google-vision-ocr ocr -f ./output.csv
exec: ./Pictures/1.png	abc
exec: ./Pictures/2.png	父母

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址