Skip to content

build-ai-applications/Eval-Image-Text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“„ Image to Text Evaluation

๐Ÿš€ 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.

โš–๏ธ OCR Frameworks Compared

๐Ÿ“Œ 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.

๐Ÿ“Š Key Evaluation Metrics

โœ… 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.

โš™๏ธ Performance Comparison

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

๐ŸŽฏ Summary of Findings

  • 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.

๐Ÿš€ How to Use

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.

๐Ÿค Contributing

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.

๐Ÿ“œ License

This project is licensed under the Apache 2.0, allowing free and open usage, modification, and distribution.

๐Ÿ”— References

About

๐Ÿ“„Image to Text Evaluation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •