ankur6ue / aster-ocr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example Package

This package implements basic OCR functionality. It consists of a text detection module and a text recognition module.

To build package:

cd to package top level directory and: python3 setup.py sdist bdist_wheel

To create conda env:

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.

To create requirements.txt

cd to package top level directory and use: pip3 freeze > requirements.txt

About

License:MIT License


Languages

Language:Python 98.1%Language:Dockerfile 1.4%Language:Shell 0.6%