Skip to main content

A simple LaTeX OCR package

Project description

Simple-LaTeX-OCR

Performance

BLEU score normed edit distance token accuracy
0.92 0.05 0.75

Online experience

https://huggingface.co/spaces/chaodreaming/Simple-LaTeX-OCR

https://www.modelscope.cn/studios/chaodreaming/Simple-LaTeX-OCR/summary

Install the package simple_latex_ocr:

pip install simple_latex_ocr

Use from within Python

from simple_latex_ocr.models import Latex_OCR
model = Latex_OCR()
img_path = "tests/test_files/5.png"
result = model.predict(img_path)
print(result['formula'])
print(result['confidence'])
print(result['elapse'])

Used by command line

$ simple_latex_ocr tests/test_files/2.png

Used by api

$ python -m simple_latex_ocr.api.run

#You can use test.py to initiate a request for verification

Using streamlit has a nice interface, but you can only select files locally.

streamlit run streamlit_app.py

img.png Using flask you can copy the formula directly

python flask_app.py

Contribution

Contributions of any kind are welcome.

Acknowledgment

Code taken and modified from lukas-blecher, RapidAI,ultralytics

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simple_latex_ocr-0.0.9.tar.gz (18.0 kB view hashes)

Uploaded Source

Built Distribution

simple_latex_ocr-0.0.9-py3-none-any.whl (19.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page