salarymakage commited on
Commit
68c3d3a
ยท
1 Parent(s): 520e23d

first version

Browse files
Files changed (3) hide show
  1. README.md +34 -0
  2. model.onnx +3 -0
  3. model_vocab.json +186 -0
README.md ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Model 9k (Small)
2
+
3
+ This directory contains a **lightweight** version of the **ThaoNet** recognition model, trained on approximately **9,000** samples (Khmer script).
4
+
5
+ ## Model Architecture (`model-small`)
6
+
7
+ This model uses the **ThaoNet-Small** architecture, optimized for speed and low memory usage.
8
+
9
+ | Component | Setting | Notes |
10
+ |-----------|---------|-------|
11
+ | **Backbone** | `lightweight` | Use a 3-stage CNN (faster than ResNet). |
12
+ | **Head** | `transformer_ctc` | Shallow Transformer (2 layers, d=128). |
13
+ | **Input Size** | `32px` | Lower resolution for speed. |
14
+ | **Params** | **~1.6 Million** | Very small, suitable for mobile/CPU. |
15
+
16
+ ## Usage
17
+
18
+ ### 1. Run Inference (ONNX)
19
+
20
+ ```bash
21
+ python tools/export/predict.py \
22
+ --onnx model9k/model.onnx \
23
+ --vocab model9k/model_vocab.json \
24
+ --image path/to/image.png \
25
+ --height 32
26
+ ```
27
+ *Note: Ensure you use `--height 32` as this model was trained on lower resolution images.*
28
+
29
+ ### 2. Performance & Data
30
+ * **Training Data**: 9,000 (9k) synthetic Khmer text line images.
31
+ * **CER (Character Error Rate)**: ~15-20% (Estimated on diverse data).
32
+ * **WER (Word Error Rate)**: ~30-40%.
33
+ * **Speed**: ~2-3x faster than the base model.
34
+ * **Accuracy**: Lower than `base` or `handwriting` models, especially on complex backgrounds. Best for simple, clean, printed text.
model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4944a3d0532703de08b2fe04f42fa74b1a0be8b36d5f16a6245643fee8b650a3
3
+ size 6596604
model_vocab.json ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "itos": [
3
+ "[BLANK]",
4
+ "[PAD]",
5
+ "A",
6
+ "B",
7
+ "C",
8
+ "D",
9
+ "E",
10
+ "F",
11
+ "G",
12
+ "H",
13
+ "I",
14
+ "J",
15
+ "K",
16
+ "L",
17
+ "M",
18
+ "N",
19
+ "O",
20
+ "P",
21
+ "Q",
22
+ "R",
23
+ "S",
24
+ "T",
25
+ "U",
26
+ "V",
27
+ "W",
28
+ "X",
29
+ "Y",
30
+ "Z",
31
+ "a",
32
+ "b",
33
+ "c",
34
+ "d",
35
+ "e",
36
+ "f",
37
+ "g",
38
+ "h",
39
+ "i",
40
+ "j",
41
+ "k",
42
+ "l",
43
+ "m",
44
+ "n",
45
+ "o",
46
+ "p",
47
+ "q",
48
+ "r",
49
+ "s",
50
+ "t",
51
+ "u",
52
+ "v",
53
+ "w",
54
+ "x",
55
+ "y",
56
+ "z",
57
+ "0",
58
+ "1",
59
+ "2",
60
+ "3",
61
+ "4",
62
+ "5",
63
+ "6",
64
+ "7",
65
+ "8",
66
+ "9",
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
+ "แžˆ",
92
+ "แž‰",
93
+ "แžŠ",
94
+ "แž‹",
95
+ "แžŒ",
96
+ "แž",
97
+ "แžŽ",
98
+ "แž",
99
+ "แž",
100
+ "แž‘",
101
+ "แž’",
102
+ "แž“",
103
+ "แž”",
104
+ "แž•",
105
+ "แž–",
106
+ "แž—",
107
+ "แž˜",
108
+ "แž™",
109
+ "แžš",
110
+ "แž›",
111
+ "แžœ",
112
+ "แž",
113
+ "แžž",
114
+ "แžŸ",
115
+ "แž ",
116
+ "แžก",
117
+ "แžข",
118
+ "แžฃ",
119
+ "แžค",
120
+ "แžฅ",
121
+ "แžฆ",
122
+ "แžง",
123
+ "แžจ",
124
+ "แžฉ",
125
+ "แžช",
126
+ "แžซ",
127
+ "แžฌ",
128
+ "แžญ",
129
+ "แžฎ",
130
+ "แžฏ",
131
+ "แžฐ",
132
+ "แžฑ",
133
+ "แžฒ",
134
+ "แžณ",
135
+ "แžถ",
136
+ "แžท",
137
+ "แžธ",
138
+ "แžน",
139
+ "แžบ",
140
+ "แžป",
141
+ "แžผ",
142
+ "แžฝ",
143
+ "แžพ",
144
+ "แžฟ",
145
+ "แŸ€",
146
+ "แŸ",
147
+ "แŸ‚",
148
+ "แŸƒ",
149
+ "แŸ„",
150
+ "แŸ…",
151
+ "แŸ†",
152
+ "แŸ‡",
153
+ "แŸˆ",
154
+ "แŸ‰",
155
+ "แŸŠ",
156
+ "แŸ‹",
157
+ "แŸŒ",
158
+ "แŸ",
159
+ "แŸŽ",
160
+ "แŸ",
161
+ "แŸ",
162
+ "แŸ‘",
163
+ "แŸ’",
164
+ "แŸ ",
165
+ "แŸก",
166
+ "แŸข",
167
+ "แŸฃ",
168
+ "แŸค",
169
+ "แŸฅ",
170
+ "แŸฆ",
171
+ "แŸง",
172
+ "แŸจ",
173
+ "แŸฉ",
174
+ "แŸ”",
175
+ "แŸ•",
176
+ "แŸ–",
177
+ "แŸ—",
178
+ "แŸ˜",
179
+ "แŸ™",
180
+ "แŸš",
181
+ "โ€‹",
182
+ "โ€Œ",
183
+ "โ€"
184
+ ],
185
+ "blank_id": 0
186
+ }