This package implements basic OCR functionality. It consists of a text detection module and a text recognition module.
cd to package top level directory and: python3 setup.py sdist bdist_wheel
conda env create -f environment.yml --name ocr_test_env
conda activate ocr_test_env
cd to the newly created dist directory and run:
pip install OCR*.whl
To run sample application that runs text detection and recognition on a sample image (paper-title.jpg)
-
First download pre-trained detection and recognition models from here and extract to the models directory. After extraction, your models directory should look like:
- /models/detection-CRAFT/craft_mlt_25k.pth
- /models/recognition-ASTER/demo.pth.tar
If you download the models somewhere else, edit the paths in env_local.list accordingly
-
Run
python ocr_app.py
-
To run tests:
python tests.py
. The tests.py file also provides examples of how to use this package.
cd to package top level directory and use: pip3 freeze > requirements.txt