LaTeX OCR is a web application that converts images of equations into LaTeX code. This project uses Python, FastAPI for the backend, Streamlit for the frontend, and Celery for task management. It also involves MongoDB for data storage and Redis for Celery's message broker.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
You need to have Python installed on your machine. You can download Python here.
You also need to install MongoDB and Redis on your local machine or use the provided cloud services in the .env file.
- Clone the repository
git clone https://github.com/KenKout/OCR-AI.git
- Navigate to the project directory
cd OCR-AI
- Install the required packages
pip install -r requirements.txt
- Run the application
python run.py
The application consists of three parts which run concurrently:
- The FastAPI backend which handles requests
- The Streamlit frontend which provides the user interface
- The Celery worker which processes tasks
- Open your browser and navigate to the Streamlit server (usually localhost:8501).
- Upload an image of an equation.
- Click the 'Convert' button to start processing the image.
- The LaTeX code corresponding to the equation in the image will be displayed.
To run the application using Docker, follow these steps:
-
Make sure you have Docker installed on your machine. You can download Docker here.
-
Clone the repository
git clone https://github.com/KenKout/OCR-AI.git
- Navigate to the project directory
cd OCR-AI
- Build the Docker image
docker build -t latex-ocr .
- Run the Docker container
docker run -d -p 8000:8000 -p 8501:8501 latex-ocr
The application will be available at:
- FastAPI backend:
http://localhost:8000
- Streamlit frontend:
http://localhost:8501
- Python
- FastAPI
- Streamlit
- MongoDB
- KenKout
This project is licensed under the GNU General Public License.
- OpenAI for providing the language model
- The FastAPI team for creating a great web framework
- The Streamlit team for creating an easy-to-use way to create beautiful data apps