The encoder is resnetv2+simplevit, the decoder is transformer, the attention mechanism uses flashattention2.0 from pytorch2.0, and the dataset size is 112 million
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'])
$ simple_latex_ocr tests/test_files/2.png
$ python -m simple_latex_ocr.api.run
#You can use test.py to initiate a request for verification
Contributions of any kind are welcome.
Code taken and modified from lukas-blecher, RapidAI,ultralytics