Skip to content
/ yaOCRa Public

An OCR app built with Flask, pytesseract, and jQuery

License

Notifications You must be signed in to change notification settings

ralphqq/yaOCRa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yaOCRa

The acronym yaOCRa stands for "yet another OCR app" which basically describes what this app is all about. Try it out

Dependencies

yaOCRa uses pytesseract, Flask, and clipboard.js a third-party Javascript library for copying browser text to the clipboard.

For a full list of dependencies, please see the project's requirements.txt file.

Running yaOCRa on Local Machine

Some special steps need to be taken to install and run yaOCRa on your local machine.

Installing Tesseract Binary

First, you need to have the Tesseract binary installed on your machine.

  • For macOS users: $ brew install tesseract
  • For Ubuntu users: $ sudo apt-get install tesseract-ocr
  • For Windows users: Download UB Mannheim's unofficial installer and run it. Note that yu also need to add the path to the Tesseract executable into your PATH environment variable.

Validating Tesseract Installation

To check if you correctly installed Tesseract:

  1. Open a terminal
  2. Run tesseract -v
  3. You should now see the version and compatible libraries on your screen. Otherwise, an error occurred.

Getting reCAPTCHA Keys

yaOCRa uses Google's reCAPTCHA v2 verification system. So, sign up for an account and save the corresponding private and public keys.

Running the App

  1. Clone this repo
  2. Run pip install -r requirements.txt
  3. Create a .flaskenv file in the project root (see next section for details)
  4. Run flask run

Settings and Environment Variables

You should define the following environment variables in the .flaskenv file:

FLASK_APP=ocr_app.py
FLASK_ENV=development
FLASK_DEBUG=0
SECRET_KEY=REPLACE_WITH_APPROPRIATE_VALUE_HERE
RECAPTCHA_PUBLIC_KEY=REPLACE_WITH_APPROPRIATE_VALUE_HERE
RECAPTCHA_PRIVATE_KEY=REPLACE_WITH_APPROPRIATE_VALUE_HERE
TESTING=0

Notes:

  • Set FLASK_ENV to "production" upon deployment.
  • Set FLASK_DEBUG to 1 to enable debug mode, but set it to 0 in a production environment.
  • Set TESTING to 1 in order to disable reCAPTCHA during testing.

Live App

The app is currently deployed as a Docker container on Heroku. Give it a try.

References

The following useful resources helped made yaOCRa possible:

License

MIT License

About

An OCR app built with Flask, pytesseract, and jQuery

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published