Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- km
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
tags:
|
| 6 |
+
- ocr
|
| 7 |
+
- transformer
|
| 8 |
+
- vision
|
| 9 |
+
pipeline_tag: image-to-text
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# Khmer OCR Transformer
|
| 13 |
+
|
| 14 |
+
This repository contains a pure Transformer-based checkpoint for Khmer OCR. Images are patch-embedded and encoded by a Transformer encoder, then decoded autoregressively without any CNN or spatial transformer components.
|
| 15 |
+
|
| 16 |
+
## Installation
|
| 17 |
+
```python
|
| 18 |
+
pip install mer
|
| 19 |
+
```
|
| 20 |
+
## Usage
|
| 21 |
+
```python
|
| 22 |
+
from mer import Mer
|
| 23 |
+
|
| 24 |
+
model = Mer(markdown=True, device='cuda')
|
| 25 |
+
result = model.predict("sample_image.png")
|
| 26 |
+
print("Predicted text:", result)
|
| 27 |
+
```
|