-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathdigitsall_layer.sh
250 lines (235 loc) · 6.15 KB
/
digitsall_layer.sh
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
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
#!/bin/bash
echo -e "\n ****** Finetune one of the fully-trained existing models: ***********"
~/tesseract/src/training/tesstrain.sh \
--fonts_dir ~/.fonts \
--lang eng --linedata_only \
--noextract_font_properties \
--langdata_dir ~/langdata \
--tessdata_dir ~/tessdata_best \
--training_text ./eng.digits.training_text \
--exposures "0" \
--save_box_tiff \
--distort_image true \
--maxpages 0 \
--workspace_dir ~/tmp \
--output_dir ~/tesstutorial/digitsalldistort \
--fontlist \
"Adobe Devanagari" \
"Akchyarunicode" \
"Aksharyogini2" \
"Amiri" \
"Annapurna SIL Bold" \
"Annapurna SIL" \
"Antinoou" \
"Arial Bold Italic" \
"Arial Bold" \
"Arial Condensed" \
"Arial Heavy" \
"Arial Italic" \
"Arial Unicode MS" \
"Arial" \
"Awami Nastaliq" \
"Book Antiqua Bold Italic" \
"Book Antiqua Bold" \
"Book Antiqua Italic" \
"Book Antiqua" \
"Bookman Old Style Light Italic" \
"Bookman Old Style Light" \
"Bookman Old Style Semi-Bold Italic" \
"Bookman Old Style Semi-Bold" \
"Calibri Bold Italic" \
"Calibri Bold" \
"Calibri Italic" \
"Calibri Light Italic" \
"Calibri Light" \
"Calibri" \
"Cambria Bold Italic" \
"Cambria Bold" \
"Cambria Italic" \
"Candara Bold Italic" \
"Candara Bold" \
"Candara Italic" \
"Candara" \
"Century Gothic Bold Italic" \
"Century Gothic Bold" \
"Century Gothic Italic" \
"Century Gothic" \
"Century Schoolbook Bold Italic" \
"Century Schoolbook Bold" \
"Century Schoolbook Italic" \
"Century Schoolbook" \
"Century" \
"Chandas" \
"Comic Sans MS Bold Italic" \
"Comic Sans MS Bold" \
"Comic Sans MS Italic" \
"Comic Sans MS" \
"Consolas Bold Italic" \
"Consolas Bold" \
"Consolas Italic" \
"Consolas" \
"Constantia Bold Italic" \
"Constantia Bold" \
"Constantia Italic" \
"Constantia" \
"Corbel Bold Italic" \
"Corbel Bold" \
"Corbel Italic" \
"Corbel" \
"Courier New Bold Italic" \
"Courier New Bold" \
"Courier New Italic" \
"Courier New" \
"Ebrima Bold" \
"Ebrima" \
"Ek Mukta Bold" \
"Ek Mukta Light" \
"Ek Mukta Medium" \
"Ek Mukta Semi-Bold" \
"Ek Mukta Ultra-Bold" \
"Ek Mukta" \
"Franklin Gothic Medium, Italic" \
"Franklin Gothic Medium," \
"FreeMono Bold Italic" \
"FreeMono Bold" \
"FreeMono Italic" \
"FreeMono" \
"FreeSans Italic" \
"FreeSans Semi-Bold Italic" \
"FreeSans Semi-Bold" \
"FreeSans" \
"FreeSerif Bold Italic" \
"FreeSerif Bold" \
"FreeSerif Italic" \
"FreeSerif" \
"FreeSerifAthanasius" \
"FreeSerifAvvaShenouda" \
"FreeSerifCopt" \
"FreeSerifCopticMS" \
"FreeSerifCoptoMS" \
"FreeSerifKoptosMS" \
"FreeSerifPishoi" \
"Gabriola" \
"Gadugi Bold" \
"Gadugi" \
"Garamond Bold" \
"Garamond Italic" \
"Garamond" \
"Georgia Bold Italic" \
"Georgia Bold" \
"Georgia Italic" \
"Georgia" \
"IFAO-Grec Unicode Bold" \
"IFAO-Grec Unicode" \
"Impact Condensed" \
"Javanese Text" \
"K24 Kurdish Light, Light" \
"Kristen ITC Semi-Expanded" \
"Leelawadee UI Bold" \
"Leelawadee UI Semi-Light" \
"Leelawadee UI" \
"Lohit Devanagari" \
"Lucida Console Semi-Condensed" \
"Lucida Sans Unicode" \
"MS Reference Sans Serif" \
"MV Boli" \
"Microsoft New Tai Lue Bold" \
"Microsoft New Tai Lue" \
"Microsoft PhagsPa Bold" \
"Microsoft PhagsPa" \
"Microsoft Sans Serif" \
"Microsoft Tai Le Bold" \
"Microsoft Tai Le" \
"Mistral" \
"Monotype Corsiva Italic" \
"Myanmar Text Bold" \
"Myanmar Text" \
"NRT Reg" \
"Nakula" \
"Nawatura beta" \
"New Athena Unicode Bold Italic" \
"New Athena Unicode Bold" \
"New Athena Unicode Italic" \
"New Athena Unicode" \
"New Kramawirya" \
"Nirmala UI Bold" \
"Nirmala UI Semi-Light" \
"Nirmala UI" \
"Palatino Linotype Bold Italic" \
"Palatino Linotype Bold" \
"Palatino Linotype Italic" \
"Palatino Linotype" \
"Prada" \
"Pringgandani" \
"Pristina" \
"RudawRegular" \
"SILDoulos PigLatinDemo" \
"Sahadeva" \
"Sahel" \
"Sakkal Majalla" \
"Segoe Print Bold" \
"Segoe Print" \
"Segoe Script Bold" \
"Segoe Script" \
"Segoe UI Bold Italic" \
"Segoe UI Bold" \
"Segoe UI Emoji" \
"Segoe UI Heavy Italic" \
"Segoe UI Heavy" \
"Segoe UI Italic" \
"Segoe UI Light Italic" \
"Segoe UI Light" \
"Segoe UI Semi-Bold Italic" \
"Segoe UI Semi-Bold" \
"Segoe UI Semi-Light Italic" \
"Segoe UI Semi-Light" \
"Segoe UI Symbol" \
"Segoe UI" \
"Shobhika Bold" \
"Shobhika" \
"Siddhanta" \
"Siddhanta-Calcutta" \
"Siddhanta-Nepali" \
"Siddhanta-cakravat" \
"Sylfaen" \
"Symbola Semi-Condensed" \
"Tahoma Bold" \
"Tahoma" \
"Times New Roman, Bold Italic" \
"Times New Roman, Bold" \
"Times New Roman, Italic" \
"Times New Roman," \
"Trebuchet MS Bold Italic" \
"Trebuchet MS Bold" \
"Trebuchet MS Italic" \
"Trebuchet MS" \
"Unikurd Goran" \
"Unikurd Hejar" \
"Unikurd Roonak" \
"Unikurd Web" \
"Urdu Typesetting" \
"Uttara" \
"Verdana Bold Italic" \
"Verdana Bold" \
"Verdana Italic" \
"Verdana" \
rm -rf ~/tesstutorial/digitsalldistort_from_full
mkdir -p ~/tesstutorial/digitsall_from_full
combine_tessdata -e ~/tessdata_best/eng.traineddata \
~/tesstutorial/digitsall_from_full/eng.lstm
lstmtraining \
--model_output ~/tesstutorial/digitsall_from_full/digitsall_layer \
--traineddata ~/tesstutorial/digitsall/eng/eng.traineddata \
--continue_from ~/tesstutorial/digitsall_from_full/eng.lstm \
--append_index 5 --net_spec '[Lfx192 O1c1]' \
--train_listfile ~/tesstutorial/digitsall/eng.training_files.txt \
--debug_interval 0 \
--max_iterations 200000
lstmtraining \
--stop_training \
--traineddata ~/tesstutorial/digitsall/eng/eng.traineddata \
--continue_from ~/tesstutorial/digitsall_from_full/digitsall_layer_checkpoint \
--model_output digitsall_layer.traineddata
cp digitsall_layer.traineddata ~/tessdata_best/
## lstmeval --model ~/tessdata_best/eng.traineddata --eval_listfile ~/tesstutorial/digitsall/eng.training_files.txt
## lstmeval --verbosity 0 --model ~/tesstutorial/digitsall_from_full/digitsall_layer_checkpoint --traineddata ~/tesstutorial/digitsall/eng/eng.traineddata --eval_listfile ~/tesstutorial/digitsall/eng.training_files.txt