This project is a comprehensive OCR (Optical Character Recognition) Evaluation Framework designed to rigorously test and analyze the performance of custom OCR pipelines. It supports printed and handwritten text recognition, and delivers detailed performance insights including character-level metrics, word accuracy, and confusion matrices.
dataset/img/– Folder containing input images for OCR evaluationdataset/text/– Corresponding ground truth.txtfilesbackend.py– Includesextract_text()for OCR inference andpreprocess_image()for image preparationevaluate.py– Main evaluation script computing metrics and visualizations
- ✅ Word-Level Accuracy
- 🔠 Character-Level Accuracy
- ✏️ Average Levenshtein Distance
- 🎯 Precision, Recall, and F1 Score (char-wise)
- 🔍 Character Confusion Matrix via Seaborn heatmap
For each image in dataset/img/, the following is performed:
- Ground truth is loaded from the corresponding
.txtfile. - The image is preprocessed using
preprocess_image. - Text is extracted using a custom OCR engine via
extract_text. - Evaluation metrics are computed:
- Word-wise comparison
- Character-wise match count
- Levenshtein distance
- Confusion matrix data
Results are accumulated and visualized in real-time.