File size: 2,775 Bytes
7dd4d91
881d167
 
 
 
 
7dd4d91
 
 
881d167
 
 
 
 
 
7dd4d91
 
881d167
7dd4d91
881d167
7dd4d91
881d167
7dd4d91
881d167
c56d971
881d167
 
 
 
 
 
 
 
 
 
 
 
 
c56d971
 
881d167
 
c56d971
 
881d167
 
7dd4d91
881d167
 
 
7dd4d91
 
881d167
c56d971
881d167
 
 
 
 
 
 
 
7dd4d91
c56d971
881d167
 
 
 
 
 
 
 
 
 
 
7dd4d91
881d167
 
 
 
 
 
 
 
 
 
 
 
7dd4d91
881d167
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
license: mit
language:
  - mnw
library_name: generic
pipeline_tag: image-to-text
tags:
  - ocr
  - mon
  - resnet
  - crnn
  - tflite
  - onnx
metrics:
  - cer
---

# MonOCR (mnw) - Optical Character Recognition for Mon Language

**MonOCR** is an efficient and robust OCR model designed specifically for the Mon language (mnw). It utilizes a ResNet-18 backbone combined with BiLSTM layers and CTC loss for character recognition.

This repository serves as the official hub for MonOCR model weights, providing multiple deployment formats including PyTorch, ONNX, and TFLite.

## Model Formats

| Format                 | Path                    | Size   | Recommended Use Case         |
| :--------------------- | :---------------------- | :----- | :--------------------------- |
| **PyTorch**            | `pytorch/monocr.ckpt`   | 166 MB | Research, Fine-tuning        |
| **ONNX**               | `onnx/monocr.onnx`      | 56 MB  | Server/Desktop Inference     |
| **TFLite (Quantized)** | `tflite/monocr.tflite`  | 14 MB  | **Mobile & Edge Deployment** |
| **TFLite (float16)**   | `tflite/float16.tflite` | 28 MB  | High-efficiency mobile       |
| **TFLite (float32)**   | `tflite/float32.tflite` | 56 MB  | High-precision mobile        |

## Quick Start

### Python (Inference)

The easiest way to use the model is with our [universal Python bindings](https://github.com/janakh/monocr-onnx):

```bash
pip install monocr-onnx
monocr-download --dest model
```

```python
from monocr_onnx import MonOCR

ocr = MonOCR("model/onnx/monocr.onnx", "model/charset.txt")
text = ocr.predict("image.jpg")
print(text)
```

## Training Details

- **Architecture**: ResNet-18 + BiLSTM (2 layers, 256 hidden units) + Linear Head.
- **Input Size**: Grayscale, Height 64, Variable Width.
- **Dataset**: 1,000,000 synthetic samples generated from Mon news corpora.
- **Final Metrics**:
  - Validation Loss: 0.05
  - Validation CER: ~0.02 (2% Character Error Rate)

## Repository Structure

```
.
β”œβ”€β”€ charset.txt             # Character mapping (224 characters)
β”œβ”€β”€ monocr.json             # Model metadata & configuration
β”œβ”€β”€ pytorch/                # PyTorch Lightning Checkpoints
β”œβ”€β”€ onnx/                   # ONNX exports (Dynamic width)
└── tflite/                 # TFLite variants (Quantized & Float)
```

## Usage & Integration

For native bindings in **Go, JavaScript, and Rust**, please visit the [monocr-onnx](https://github.com/janakh/monocr-onnx) repository.

## Citation & License

If you use this model in your project, please cite:

```bibtex
@software{monocr2026,
  author = {Janakh},
  title = {MonOCR: Production-Ready OCR for Mon Language},
  version = {1.0.0},
  year = {2026}
}
```

This model is released under the **MIT License**.