FastAPI-based API to convert LateX formula images into LaTeX code using a pre-trained Transformer model.
Clone the repository
git clone https://github.com/olmobaldoni/LaTex-Formula-OCR-API.git
cd LaTex-Formula-OCR-API/appInstall dependencies
pip install -r requirements.txtRun the API
fastapi dev main.pyBuild the Docker image
docker build -t latex-ocr-api .Run the Docker container
docker run -d --name nougat-ocr-api-container -p 80:80 latex-ocr-apiAccess the API
Open your web browser and go to localhost/docs to access the Swagger UI for the API.
Pull the Docker image
docker pull olmobaldoni/nougat-ocr-api:latestRun the Docker container
docker run -d --name nougat-ocr-api-container -p 80:80 olmobaldoni/nougat-ocr-api:latestAccess the API
Open your web browser and go to localhost/docs to access the Swagger UI for the API.
- URL: /upload_latex_image/
- Method: POST
- Description: Upload an image containing LaTeX formula to receive the corresponding LaTeX code.
- Request:
- 'file': The image file containing the LaTeX formula.
- Response: Plain text containing the LaTeX code.
This API is based on nougat-latex-base, a fine-tuning of facebook/nougat-base with im2latex-100k, and made by NormXU.
MIT
