forked from ocropus-archive/DUP-ocropy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ocrotest-commands
executable file
·46 lines (33 loc) · 1.05 KB
/
ocrotest-commands
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
#!/bin/bash -x
set -e
die() {
echo ERROR "$*"
exit 255
}
TEST() {
echo '######' "$*"
}
rm -rf _test _test.*
TEST binarize
# ocropus-binarize isri0188/000[1-4].png -o _test || die
ocropus-binarize isri0188/000[12].png -o _test || die
cp isri0188/*.gt.txt _test/
TEST pseg
ocropus-pseg _test/????.png || die
TEST linerec
ocropus-lattices -O -m models/uw3-unlv-2011-03-07.023.cmodel _test/????/??????.png || die
ocropus-align -O -l models/default.fst _test/????/??????.png || die
TEST align-with-groundtruth
ocropus-align -Q 0 -p _test/*.gt.txt -X -x _test.db
ocropus-dbinfo _test.db
ocrotest-dbcheck _test.db || echo "FAILED"
TEST training
ocropus-ctrain -K 8 -o _test.cmodel _test.db || die
TEST reclassifying
ocropus-lattices -O -m _test.cmodel _test/????/??????.png || die
TEST extract-rseg
ocropus-extract-rsegs _test/????/??????.png -o _test/rsegs.db || die
TEST cluster-eps
ocropus-cluster-eps _test/rsegs.db _test/rsegs-eps.db || die
#TEST cluster-kmeans
#ocropus-cluster-kmeans -n 10 -t clusters _test/rsegs-eps.db _test/rsegs-km.db || die