Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- th
|
| 4 |
+
- en
|
| 5 |
+
metrics:
|
| 6 |
+
- cer
|
| 7 |
+
tags:
|
| 8 |
+
- easyocr
|
| 9 |
+
- image-to-text
|
| 10 |
+
pipeline_tag: image-to-text
|
| 11 |
+
library_name: transformers
|
| 12 |
+
license: apache-2.0
|
| 13 |
+
---
|
| 14 |
+
# PalOCR Model
|
| 15 |
+
|
| 16 |
+
## Introduction
|
| 17 |
+
|
| 18 |
+
PalOCR is a CRNN ('None-VGG-BiLSTM-CTC') model trained with solely purpose of getting a better score of openthaigpt/thai-ocr-evaluation datasets due to limitation of author hardware.
|
| 19 |
+

|
| 20 |
+
|
| 21 |
+
## Training Dataset
|
| 22 |
+
|
| 23 |
+
Generated images of openthaigpt/thai-ocr-evaluation datasets using [TextRecognitionDataGenerator](https://github.com/Belval/TextRecognitionDataGenerator).
|
| 24 |
+
|
| 25 |
+
## How to Use
|
| 26 |
+
|
| 27 |
+
Here’s how to use this model in Python:
|
| 28 |
+
|
| 29 |
+
```python
|
| 30 |
+
import easyocr
|
| 31 |
+
reader = easyocr.Reader(["th", "en"], gpu=True, recog_network="palocr")
|
| 32 |
+
result = reader.readtext('text.jpg')
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
## Model Performance Comparison
|
| 36 |
+
|
| 37 |
+
This section details the performance comparison between the open-source ThaiTrOCR model and other widely-used OCR systems, namely EasyOCR and Tesseract. The table below highlights their respective performance across various document types based on the average Character Error Rate (CER).
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
| Category | EasyOCR | PalOCR | Tesseract |
|
| 41 |
+
|:--------------|-----------:|-----------:|-----------:|
|
| 42 |
+
| real_document | 0.220217 | **0.960289** | 0.915707 |
|
| 43 |
+
| scene_text | 0.35865 | **1.0211** | 2.408704 |
|
| 44 |
+
| handwritten | 0.409302 | **1.01395** | 1.032375 |
|
| 45 |
+
| document | 0.0871795 | **0.946154** | 0.761595 |
|
| 46 |
+
| document_enth | 0.275449 | **0.916168** | 1.061107 |
|
| 47 |
+
|
| 48 |
+
**Disclaimer**: While this model is train on generated images of evaluation datasets, It was train on roughly 1,000 of generated images.
|
| 49 |
+
|
| 50 |
+
# Key Insights
|
| 51 |
+
|
| 52 |
+
* Character Error Rate (CER): This metric evaluates the percentage of characters that were incorrectly predicted by the model. A lower CER indicates better performance. As shown in the table, ThaiTrOCR consistently outperforms EasyOCR and Tesseract across all document types, with a significantly lower average CER, making it the most accurate model in the comparison.
|
| 53 |
+
* Tesseract Limitation: It’s important to note that Tesseract only supports single-language input at a time in this comparison. For the purposes of this benchmark, it was tested using only the Thai language setting, which might have contributed to its higher CER values.
|
| 54 |
+
* The evaluation dataset is sourced from the [openthaigpt/thai-ocr-evaluation](https://huggingface.co/datasets/openthaigpt/thai-ocr-evaluation).
|
| 55 |
+
|
| 56 |
+
## Authors
|
| 57 |
+
|
| 58 |
+
- Vorakan Sumethsenee (vorkna@proton.me)
|