Metadata-Version: 2.1
Name: simple-latex-ocr
Version: 0.0.2
Summary: A simple LaTeX OCR package
Home-page: https://github.com/chaodreaming/Simple-LaTeX-OCR
Author: chaodreaming
Author-email: chaodreaming@gmail.com
License: Apache-2.0
Keywords: ocr, image to text, latex
Platform: Any
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: onnxruntime-gpu
Requires-Dist: tokenizers >=0.13.2
Requires-Dist: numpy
Requires-Dist: opencv-python
Requires-Dist: Pillow >=9.2.0
Requires-Dist: PyYAML >=6.0.0
Requires-Dist: transformers
Requires-Dist: flask
Requires-Dist: fastapi
Requires-Dist: uvicorn
Requires-Dist: simple-latex-ocr
Requires-Dist: opencv-python-headless
Requires-Dist: easydict >=1.13

# Simple-LaTeX-OCR
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'])

#### Used by command line
```bash
$ simple_latex_ocr tests/test_files/2.png

#detect img time: ： 0.8883707523345947
#x^{2}+y^{2}=1
#99.28%
#1,360ms

```


#### Used by api
```bash
$ python -m simple_latex_ocr.api.run

#You can use test.py to initiate a request for verification
```
## Contribution
Contributions of any kind are welcome.

## Acknowledgment
Code taken and modified from [lukas-blecher](https://github.com/lukas-blecher/LaTeX-OCR), [RapidAI](https://github.com/RapidAI/RapidLaTeXOCR),[ultralytics](https://github.com/ultralytics/ultralytics)
