OCR using Google's Drive API

95 views
Skip to first unread message

Hrishikesh Terdalkar

unread,
Jun 15, 2021, 5:15:48 AM6/15/21
to sanskrit-p...@googlegroups.com
A few days ago there was a post regarding OCR software using Drive API for Windows.

I have been using a python script for this purpose on Linux for the past few years. I've turned that into a pip package.

$ pip install google_drive_ocr

It will install an executable `google-ocr`

Some use cases,
$ google-ocr -i image.png
$ google-ocr -b image1.png image2.png image3.png
$ google-ocr --image-dir images/ --extension .jpg --workers 4

Core workflow is,
* Upload an image "as a google document" to Google Drive
* Upon doing this, google adds the OCR layer

* Download google document as plain text
A primary difficulty in using this might be setting up a project on Google Cloud platform and downloading a client_secret.json file.

Once done, client_secret.json file needs to be provided
in every call. (To avoid this, one can do
$ google-ocr --client-secret /full/path/to/client-secret.json --write-config ~/.gdo.cfg

Once that is done, next time onwards no  --client-secret option is required.

Regards,
-
हृषीकेश

Mārcis Gasūns

unread,
Jul 16, 2021, 11:27:48 AM7/16/21
to sanskrit-programmers
So guess it has the same engine as http://ocr.sanskritdictionary.com/ has.
Message has been deleted

ken p

unread,
Jul 16, 2021, 11:38:30 AM7/16/21
to sanskrit-programmers
How can I drag image here or post copied image here without uploading file?
Paste, drop, or upload your image
Reply all
Reply to author
Forward
0 new messages