An open API service indexing awesome lists of open source software.

https://github.com/negarhonarvar/equation-solving-ocr

An Equation Solving Model for hand written equations, enahned by Tesseract
https://github.com/negarhonarvar/equation-solving-ocr

cv2 pil pytorch tesseract-ocr torchvision

Last synced: 6 months ago
JSON representation

An Equation Solving Model for hand written equations, enahned by Tesseract

Awesome Lists containing this project

README

          

# Equation Solver with OCR

This repository implements a full pipeline to classify and solve equations from images using deep learning and OCR techniques. It supports both **handwritten** and **typed** expressions and reconstructs them into solvable strings.

## Overview ๐Ÿš€

The system processes input equation images by:

- Classifying the equation as handwritten or typed
- Segmenting and recognizing characters using:
- CNN trained on MNIST and a custom symbol dataset
- Tesseract and EasyOCR for OCR-based recognition
- Reconstructing the equation
- Solving the expression and saving results

## Dataset ๐Ÿ“

All training and test data are available in this shared Google Drive folder:

[Equation Dataset - Google Drive](https://drive.google.com/drive/folders/13nICjIQg57NhPn5eYJwZp1jCpJwk4vjp)

## How to Use ๐Ÿ› 

### 1. Clone the Repository

git clone https://github.com/yourusername/equation-ocr-solver.git
cd equation-ocr-solver

### 2. Install Dependencies

pip install -r requirements.txt

If you're running in Google Colab, also install Tesseract with:

!apt-get install tesseract-ocr

### 3. Run the Notebook
Open and run the following notebook in Google Colab:

EquationSolving-OCR.ipynb

### 4. Output
After running the full pipeline, a file named submission.csv will be generated containing:

- The predicted type of each equation image (typed or handwritten)

- The evaluated result of the expression

## Project Structure ๐Ÿ“ฆ

โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ EquationSolving-OCR.ipynb # Original notebook (Colab)
โ”œโ”€โ”€ equationsolving_ocr.py # Exported script version of the notebook
โ”œโ”€โ”€ drive/
โ”‚ โ”œโ”€โ”€ train/ # Training images
โ”‚ โ”œโ”€โ”€ test/ # Test images
โ”‚ โ”œโ”€โ”€ train_info.csv # Labels for training
โ”‚ โ””โ”€โ”€ submission.csv # Generated predictions

## License ๐Ÿงพ
This project is licensed under the MIT License. See the LICENSE file for details.