salarymakage commited on
Commit
0dc001e
ยท
1 Parent(s): 68c3d3a
Files changed (4) hide show
  1. README.md +20 -1
  2. config.yml +12 -0
  3. khmer_dict.txt +179 -0
  4. model.safetensors +3 -0
README.md CHANGED
@@ -13,6 +13,17 @@ This model uses the **ThaoNet-Small** architecture, optimized for speed and low
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)
@@ -26,7 +37,15 @@ python tools/export/predict.py \
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%.
 
13
  | **Input Size** | `32px` | Lower resolution for speed. |
14
  | **Params** | **~1.6 Million** | Very small, suitable for mobile/CPU. |
15
 
16
+ ## File Structure
17
+ ```
18
+ model9k/
19
+ โ”œโ”€โ”€ model.safetensors # PyTorch weights (SafeTensors format)
20
+ โ”œโ”€โ”€ model.onnx # Exported ONNX model
21
+ โ”œโ”€โ”€ config.yml # Model configuration
22
+ โ”œโ”€โ”€ khmer_dict.txt # Character vocabulary list
23
+ โ”œโ”€โ”€ model_vocab.json # Full vocabulary mapping
24
+ โ””โ”€โ”€ README.md # This file
25
+ ```
26
+
27
  ## Usage
28
 
29
  ### 1. Run Inference (ONNX)
 
37
  ```
38
  *Note: Ensure you use `--height 32` as this model was trained on lower resolution images.*
39
 
40
+ ### 2. Load Weights (SafeTensors)
41
+
42
+ ```python
43
+ from safetensors.torch import load_file
44
+ state_dict = load_file("model9k/model.safetensors")
45
+ # load into model...
46
+ ```
47
+
48
+ ### 3. Performance & Data
49
  * **Training Data**: 9,000 (9k) synthetic Khmer text line images.
50
  * **CER (Character Error Rate)**: ~15-20% (Estimated on diverse data).
51
  * **WER (Word Error Rate)**: ~30-40%.
config.yml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ model:
2
+ name: small
3
+ target_h: 32
4
+ backbone:
5
+ type: lightweight
6
+ head:
7
+ type: transformer_ctc
8
+ d_model: 128
9
+ num_layers: 2
10
+ vocab:
11
+ blank_token: '[BLANK]'
12
+ pad_token: '[PAD]'
khmer_dict.txt ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ A
2
+ B
3
+ C
4
+ D
5
+ E
6
+ F
7
+ G
8
+ H
9
+ I
10
+ J
11
+ K
12
+ L
13
+ M
14
+ N
15
+ O
16
+ P
17
+ Q
18
+ R
19
+ S
20
+ T
21
+ U
22
+ V
23
+ W
24
+ X
25
+ Y
26
+ Z
27
+ a
28
+ b
29
+ c
30
+ d
31
+ e
32
+ f
33
+ g
34
+ h
35
+ i
36
+ j
37
+ k
38
+ l
39
+ m
40
+ n
41
+ o
42
+ p
43
+ q
44
+ r
45
+ s
46
+ t
47
+ u
48
+ v
49
+ w
50
+ x
51
+ y
52
+ z
53
+ 0
54
+ 1
55
+ 2
56
+ 3
57
+ 4
58
+ 5
59
+ 6
60
+ 7
61
+ 8
62
+ 9
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
+ แžŒ
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
+ โ€
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0a4b4f5a36fb5f5bd4a08164bf4d9d7bbcd3c2ce47f05f6a3e34bc8ef6620182
3
+ size 6550612