Giter VIP home page Giter VIP logo

simple-latex-ocr's Introduction

Simple-LaTeX-OCR

Performance

BLEU score normed edit distance token accuracy
0.92 0.05 0.75

Online experience

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

A simple interface for uploading files can be used to edit the results using latexlive.```

python flask_app.py

img_1.png

Contribution

Contributions of any kind are welcome.

Acknowledgment

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

simple-latex-ocr's People

Contributors

chaodreaming avatar

Stargazers

listen avatar E_L avatar paul avatar Andranik Sargsyan avatar Qing avatar  avatar zhong-yiyu avatar  avatar Ma Qiang avatar Knight-Gu avatar Dmitry Karpenko avatar  avatar 李子皓 avatar  avatar zhaoyun007 avatar  avatar  avatar Jarkko avatar  avatar  avatar Zheng Bowen avatar vencent,W.jun avatar  avatar Levan Kankadze (ლევან კანკაძე) avatar  avatar Kreijstal avatar  avatar

Watchers

 avatar

Forkers

yrq66

simple-latex-ocr's Issues

LaTeX without style components

Hi @chaodreaming
Thank you for this repository.

Is possible make API to predict image to without LaTeX style components

for example now from this input image :

math

output LaTeX is :

(\mathfrak{a}+\mathfrak{b})^{2}=\mathfrak{a}^{2}+2\mathfrak{a}\mathfrak{b}+\mathfrak{b}^{2}

without style components is :

({a}+{b})^{2}={a}^{2}+2{a}{b}+{b}^{2}

OCR failure example

test

result:
$$
\left[\dot{i}{d}\right]=\frac{2}{3}(\left[-\frac{Z}{L}\quad\omega\right]\left[i{d}\right]+\left[\frac{V_{d c}}{L}\quad0\right]\left[D_{d}\right])
$$

image

How to use?

I know this was a lot of hard work, but how do you use it from the command line?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.