Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
49 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,15 @@ | ||
#!/bin/bash -e | ||
BASE=$(dirname $0) | ||
|
||
# 'RUNNER' is the binary that the scripts are executed by. It defaults to | ||
# 'python2' if not set in the environment. | ||
# Examples: | ||
# PATH=$PWD:$PATH RUNNER='coverage run --include=$PWD/**/*' ./run-test | ||
# PATH=$PWD:$PATH RUNNER='python3' ./run-test | ||
# See ./run-coverage for a real example. | ||
RUNNER="${RUNNER:-python2}" | ||
|
||
test_page() { | ||
set -x | ||
$RUNNER ocropus-nlbin "$BASE/tests/testpage.png" -o temp | ||
$RUNNER ocropus-gpageseg 'temp/????.bin.png' | ||
$RUNNER ocropus-rpred -n 'temp/????/??????.bin.png' | ||
$RUNNER ocropus-hocr 'temp/????.bin.png' -o temp.html | ||
$RUNNER ocropus-visualize-results temp | ||
$RUNNER ocropus-gtedit html temp/????/??????.bin.png -o temp-correction.html | ||
set +x | ||
echo "# to see recognition results, type: firefox temp.html" | ||
echo "# to see correction page, type: firefox temp-correction.html" | ||
echo "# to see details on the recognition process, type: firefox temp/index.html" | ||
} | ||
|
||
test_conf() { | ||
local TESTIMAGE=0079-01000d | ||
mkdir -p temp | ||
cp "$BASE/tests/$TESTIMAGE"* temp | ||
set -x | ||
$RUNNER ocropus-rpred temp/$TESTIMAGE.png | ||
$RUNNER ocropus-errs temp/$TESTIMAGE.gt.txt | ||
$RUNNER ocropus-econf temp/$TESTIMAGE.gt.txt | ||
} | ||
|
||
rm -rf temp | ||
test_page | ||
test_conf | ||
BASE=$(dirname $0) | ||
|
||
rm -rf temp | ||
ocropus-nlbin $BASE/tests/testpage.png -o temp | ||
ocropus-gpageseg 'temp/????.bin.png' | ||
ocropus-rpred -n 'temp/????/??????.bin.png' | ||
ocropus-hocr 'temp/????.bin.png' -o temp.html | ||
ocropus-visualize-results temp | ||
ocropus-gtedit html temp/????/??????.bin.png -o temp-correction.html | ||
|
||
echo "to see recognition results, type: firefox temp.html" | ||
echo "to see correction page, type: firefox temp-correction.html" | ||
echo "to see details on the recognition process, type: firefox temp/index.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,39 @@ | ||
#!/bin/bash -e | ||
|
||
BASE=$(dirname "$0") | ||
|
||
rm -rf temp | ||
ocropus-nlbin "$BASE"/tests/testpage.png -o temp | ||
ocropus-gpageseg 'temp/????.bin.png' | ||
ocropus-rpred --parallel=0 --nocheck 'temp/0001/01000?.bin.png' | ||
ocropus-hocr 'temp/????.bin.png' -o temp.html 2>/dev/null | ||
ocropus-visualize-results temp | ||
ocropus-gtedit html temp/????/??????.bin.png -o temp-correction.html | ||
BASE=$(dirname $0) | ||
|
||
# 'RUNNER' is the binary that the scripts are executed by. It defaults to | ||
# 'python2' if not set in the environment. | ||
# Other examples: | ||
# PATH=$PWD:$PATH RUNNER='python2 -m coverage run --include=$PWD/**/*' ./run-test | ||
# PATH=$PWD:$PATH RUNNER='python3' ./run-test | ||
# See ./run-coverage for a real example. | ||
RUNNER="${RUNNER:-python2}" | ||
|
||
test_page() { | ||
set -x | ||
$RUNNER ocropus-nlbin "$BASE/tests/testpage.png" -o temp | ||
$RUNNER ocropus-gpageseg 'temp/????.bin.png' | ||
$RUNNER ocropus-rpred --parallel=0 --nocheck 'temp/0001/01000?.bin.png' | ||
$RUNNER ocropus-hocr 'temp/????.bin.png' -o temp.html 2>/dev/null | ||
$RUNNER ocropus-visualize-results temp | ||
$RUNNER ocropus-gtedit html temp/????/??????.bin.png -o temp-correction.html | ||
set +x | ||
echo "# to see recognition results, type: firefox temp.html" | ||
echo "# to see correction page, type: firefox temp-correction.html" | ||
echo "# to see details on the recognition process, type: firefox temp/index.html" | ||
} | ||
|
||
test_conf() { | ||
local TESTIMAGE=0079-01000d | ||
mkdir -p temp | ||
cp "$BASE/tests/$TESTIMAGE"* temp | ||
set -x | ||
$RUNNER ocropus-rpred temp/$TESTIMAGE.png | ||
$RUNNER ocropus-errs temp/$TESTIMAGE.gt.txt | ||
$RUNNER ocropus-econf temp/$TESTIMAGE.gt.txt | ||
} | ||
|
||
rm -rf temp | ||
test_page | ||
test_conf |