๐ This repository provides a comprehensive evaluation of different OCR (Optical Character Recognition) frameworks to extract textual data from images. Users can upload an image, provide the ground truth text, and compare the results across multiple OCR frameworks.
๐ Pytesseract - A Python wrapper for Googleโs Tesseract OCR engine, providing fast text extraction.
๐ PaddleOCR - Offers fast, multi-language text extraction with high accuracy.
๐ EasyOCR - A deep-learning-based OCR framework supporting multiple languages, but less efficient in speed.
๐ DocTR - A TensorFlow/PyTorch-based OCR framework that requires high-resolution images for optimal extraction.
๐ PyOCR - A lightweight wrapper supporting multiple OCR engines, including Tesseract and Cuneiform, for basic text extraction.
โ
WER (Word Error Rate) - Measures the ratio of incorrect words to the total words in the ground truth.
โ
CER (Character Error Rate) - Calculates the ratio of incorrect characters to the total characters in the ground truth.
โ
Precision - Determines how many of the detected words were correct compared to the total recognized words.
โ
Recall - Measures how many actual words from the image were correctly recognized.
โ
Latency - Evaluates the time taken (in seconds) by each framework to process and extract text from an image.
Metric | Pytesseract | PaddleOCR | EasyOCR | DocTR | PyOCR |
---|---|---|---|---|---|
WER | 0.167 | 0.000 | 0.333 | 1.000 | 0.167 |
CER | 0.036 | 0.000 | 0.357 | 1.000 | 0.036 |
Precision | 0.923 | 1.000 | 1.000 | 0.000 | 0.923 |
Recall | 1.000 | 1.000 | 1.000 | 0.000 | 1.000 |
Latency (sec) | 0.288 | 0.207 | 1.448 | 0.062 | 0.291 |
- PaddleOCR is the best choice for fast and accurate text extraction.
- PaddleOCR, Pytesseract, and PyOCR provide fast extraction.
- EasyOCR delivers good accuracy but is the slowest among the evaluated frameworks.
- DocTR performs best with high-resolution images but may not be suitable for smaller inputs.
1๏ธโฃ Clone the repository:
git clone <repo-url>
2๏ธโฃ Navigate to the project directory:
cd image-to-text-evaluation
3๏ธโฃ Open and run the Jupyter notebook:
jupyter notebook Evaluation_Image_to_Text.ipynb
4๏ธโฃ Upload an image and run the script to evaluate OCR performance.
Contributions are welcome! Feel free to open an issue or submit a pull request if you'd like to improve the evaluation methods or add new OCR frameworks.
This project is licensed under the Apache 2.0, allowing free and open usage, modification, and distribution.