-
Notifications
You must be signed in to change notification settings - Fork 21
/
plusminus_char.sh
executable file
·91 lines (73 loc) · 3.48 KB
/
plusminus_char.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
#!/bin/bash
# $1 - TESSTRAIN_LANG
# $2 - TESSTRAIN_SCRIPT
# $3 - START_MODEL
# $4 - MODEL_NAME
# $5 - TRAIN_TYPE - FineTune, ReplaceLayer or blank (from scratch)
# $6 - TESSTRAIN_FONTS
# $7 - TESSEVAL_FONTS
# $8 - TESSTRAIN_MAX_PAGES per font
# $9 - MAX_ITERATIONS (use as integer maxiter)
# $10 - Y_MAX_CER (use as integer maxcer)
##
### rm -rf /tmp
declare -i maxiter
maxiter=${9}
echo "maxiter= " $maxiter
declare -i maxcer
maxcer=${10}
echo "maxcer= " $maxcer
echo "________________________________________________________________________"
# nohup bash plusminus_char.sh eng Latin eng engRupee FineTune ' "Andika" "Calibri" "Calibri Bold" "Calibri Bold Italic" "Calibri Italic" "Calibri Light" "Calibri Light Italic" "Cambria Bold" "Cambria Bold Italic" "Cambria Italic" "Charis SIL" "Charis SIL Bold" "Charis SIL Bold Italic" "Charis SIL Italic" "Consolas" "Consolas Bold" "Consolas Bold Italic" "Consolas Italic" "Doulos SIL" "FreeMono" "FreeMono Bold" "FreeMono Bold Italic" "FreeMono Italic" "FreeSans" "FreeSans Italic" "FreeSans Semi-Bold" "FreeSans Semi-Bold Italic" "FreeSerif" "FreeSerif Bold" "FreeSerif Bold Italic" "FreeSerif Italic" "Microsoft Sans Serif" "Quivira" "Symbola Semi-Condensed" "Tahoma" "Tahoma Bold" "Times New Roman," "Times New Roman, Bold" "Times New Roman, Bold Italic" "Times New Roman, Italic" "Unifont Medium" ' ' "Andika" "Calibri" "Calibri Bold" "Calibri Bold Italic" "Calibri Italic" "Calibri Light" "Calibri Light Italic" "Cambria Bold" "Cambria Bold Italic" "Cambria Italic" "Charis SIL" "Charis SIL Bold" "Charis SIL Bold Italic" "Charis SIL Italic" "Consolas" "Consolas Bold" "Consolas Bold Italic" "Consolas Italic" "Doulos SIL" "FreeMono" "FreeMono Bold" "FreeMono Bold Italic" "FreeMono Italic" "FreeSans" "FreeSans Italic" "FreeSans Semi-Bold" "FreeSans Semi-Bold Italic" "FreeSerif" "FreeSerif Bold" "FreeSerif Bold Italic" "FreeSerif Italic" "Microsoft Sans Serif" "Quivira" "Symbola Semi-Condensed" "Tahoma" "Tahoma Bold" "Times New Roman," "Times New Roman, Bold" "Times New Roman, Bold Italic" "Times New Roman, Italic" "Unifont Medium" ' 0 99999 2 > data/logs/engRupee.log &
rm -rf /tmp
echo "________________________________________________________________________"
make MODEL_NAME=$4 clean-groundtruth clean-output
echo "________________________________________________________________________"
# font 2 lstmf lists
make \
TESSDATA=data \
TESSTRAIN_FONTS_DIR=/usr/share/fonts \
TESSTRAIN_TEXT=data/langdata/$4-train.training_text \
TESSEVAL_TEXT=data/langdata/$4-eval.training_text \
TESSTRAIN_MAX_PAGES=$8 \
TESSTRAIN_LANG=$1 \
TESSTRAIN_SCRIPT=$2 \
START_MODEL=$3 \
MODEL_NAME=$4 \
TESSTRAIN_FONTS="$6" \
TESSEVAL_FONTS="$7" \
lists
echo "________________________________________________________________________"
# lstmf to model
make \
TESSDATA=data \
DEBUG_INTERVAL=0 \
TESSTRAIN_LANG=$1 \
TESSTRAIN_SCRIPT=$2 \
START_MODEL=$3 \
MODEL_NAME=$4 \
TRAIN_TYPE=$5 \
MAX_ITERATIONS=$maxiter \
training
echo "________________________________________________________________________"
# checkpoints to traineddata
make \
TESSDATA=data \
MODEL_NAME=$4 \
traineddata
echo "________________________________________________________________________"
# lstmeval and ocreval
make \
TESSDATA=data \
MODEL_NAME=$4 \
TRAIN_TYPE=$5 \
evalCER
echo "________________________________________________________________________"
# plotting
make \
TESSDATA=data \
MODEL_NAME=$4 \
TRAIN_TYPE=$5 \
Y_MAX_CER=$maxcer \
plotCER
echo "________________________________________________________________________"