mirror of
https://github.com/qurator-spk/ocrd-galley.git
synced 2025-06-09 22:59:53 +02:00
✨ Add a simple test runner and move tests to subdirectory
This commit is contained in:
parent
b01d2ca6a1
commit
7b5f593709
14 changed files with 24 additions and 0 deletions
14
tests/test-core.sh
Executable file
14
tests/test-core.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
set -ex
|
||||
|
||||
test_id=`basename $0`
|
||||
cd `mktemp -d /tmp/$test_id-XXXXX`
|
||||
|
||||
# Prepare test workspace
|
||||
wget https://qurator-data.de/examples/actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
unzip actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
cd actevedef_718448162.first-page+binarization+segmentation
|
||||
|
||||
# Run tests
|
||||
ocrd workspace validate \
|
||||
--page-coordinate-consistency off
|
13
tests/test-dinglehopper.sh
Executable file
13
tests/test-dinglehopper.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
set -ex
|
||||
|
||||
test_id=`basename $0`
|
||||
cd `mktemp -d /tmp/$test_id-XXXXX`
|
||||
|
||||
# Prepare test workspace
|
||||
wget https://qurator-data.de/examples/actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
unzip actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
cd actevedef_718448162.first-page+binarization+segmentation
|
||||
|
||||
# Run tests
|
||||
ocrd-dinglehopper -I OCR-D-GT-PAGE,OCR-D-SEG-LINE-SBB -O DINGLEHOPPER-TEST
|
16
tests/test-eynollah.sh
Executable file
16
tests/test-eynollah.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
set -ex
|
||||
|
||||
test_id=`basename $0`
|
||||
cd `mktemp -d /tmp/$test_id-XXXXX`
|
||||
|
||||
# Prepare processors
|
||||
ocrd resmgr download ocrd-eynollah-segment default
|
||||
|
||||
# Prepare test workspace
|
||||
wget https://qurator-data.de/examples/actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
unzip actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
cd actevedef_718448162.first-page+binarization+segmentation
|
||||
|
||||
# Run tests
|
||||
ocrd-eynollah-segment -P models default -I OCR-D-IMG-BIN -O TEST-EYNOLLAH-SEG
|
16
tests/test-ocrd_anybaseocr.sh
Executable file
16
tests/test-ocrd_anybaseocr.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
set -ex
|
||||
|
||||
test_id=`basename $0`
|
||||
cd `mktemp -d /tmp/$test_id-XXXXX`
|
||||
|
||||
# Prepare processors
|
||||
|
||||
# Prepare test workspace
|
||||
wget https://qurator-data.de/examples/actevedef_718448162.first-page.zip
|
||||
unzip actevedef_718448162.first-page.zip
|
||||
cd actevedef_718448162.first-page
|
||||
|
||||
# Run tests
|
||||
ocrd-anybaseocr-binarize -I OCR-D-IMG -O OCR-D-BIN -P operation_level page -P threshold 0.3
|
||||
ocrd-anybaseocr-deskew -I OCR-D-BIN -O OCR-D-DESKEW -P maxskew 5.0 -P skewsteps 20 -P operation_level page
|
16
tests/test-ocrd_calamari.sh
Executable file
16
tests/test-ocrd_calamari.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
set -ex
|
||||
|
||||
test_id=`basename $0`
|
||||
cd `mktemp -d /tmp/$test_id-XXXXX`
|
||||
|
||||
# Prepare processors
|
||||
ocrd resmgr download ocrd-calamari-recognize qurator-gt4histocr-1.0
|
||||
|
||||
# Prepare test workspace
|
||||
wget https://qurator-data.de/examples/actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
unzip actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
cd actevedef_718448162.first-page+binarization+segmentation
|
||||
|
||||
# Run tests
|
||||
ocrd-calamari-recognize -I OCR-D-SEG-LINE-SBB -O OCR-D-OCR-CALA -P checkpoint_dir qurator-gt4histocr-1.0
|
30
tests/test-ocrd_cis.sh
Executable file
30
tests/test-ocrd_cis.sh
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/bin/sh
|
||||
set -ex
|
||||
|
||||
test_id=`basename $0`
|
||||
cd `mktemp -d /tmp/$test_id-XXXXX`
|
||||
|
||||
OCRD_CIS_OCROPY_MODEL=fraktur.pyrnn.gz
|
||||
|
||||
# Prepare processors
|
||||
ocrd resmgr download ocrd-cis-ocropy-recognize $OCRD_CIS_OCROPY_MODEL
|
||||
|
||||
# Prepare test workspace
|
||||
wget https://qurator-data.de/examples/actevedef_718448162.first-page.zip
|
||||
unzip actevedef_718448162.first-page.zip
|
||||
cd actevedef_718448162.first-page
|
||||
|
||||
# XXX ocrd-cis-ocropy-segment wasn't happy with the binarized input (no
|
||||
# "binarized" AlternativeImage?!), so we do it here again
|
||||
ocrd-skimage-binarize -I OCR-D-IMG -O OCR-D-IMG-BIN
|
||||
|
||||
# Run tests
|
||||
ocrd-cis-ocropy-segment \
|
||||
-I OCR-D-IMG-BIN -O TEST-CIS-OCROPY-SEG-LINE \
|
||||
-P level-of-operation page
|
||||
test "$(grep TextLine TEST-CIS-OCROPY-SEG-LINE/*.xml | wc -l)" -gt 50
|
||||
|
||||
ocrd-cis-ocropy-recognize \
|
||||
-I TEST-CIS-OCROPY-SEG-LINE -O TEST-CIS-OCROPY-OCR \
|
||||
-P model $OCRD_CIS_OCROPY_MODEL
|
||||
test "$(grep Unicode TEST-CIS-OCROPY-OCR/*.xml | wc -l)" -gt 50
|
13
tests/test-ocrd_fileformat.sh
Executable file
13
tests/test-ocrd_fileformat.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
set -ex
|
||||
|
||||
test_id=`basename $0`
|
||||
cd `mktemp -d /tmp/$test_id-XXXXX`
|
||||
|
||||
# Prepare test workspace
|
||||
wget https://qurator-data.de/examples/actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
unzip actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
cd actevedef_718448162.first-page+binarization+segmentation
|
||||
|
||||
# Run tests
|
||||
ocrd-fileformat-transform -I OCR-D-GT-PAGE -O OCR-TEST-CONVERT
|
13
tests/test-ocrd_olena.sh
Executable file
13
tests/test-ocrd_olena.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
set -ex
|
||||
|
||||
test_id=`basename $0`
|
||||
cd `mktemp -d /tmp/$test_id-XXXXX`
|
||||
|
||||
# Prepare test workspace
|
||||
wget https://qurator-data.de/examples/actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
unzip actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
cd actevedef_718448162.first-page+binarization+segmentation
|
||||
|
||||
# Run tests
|
||||
ocrd-olena-binarize -I OCR-D-IMG -O TEST-OLENA
|
13
tests/test-ocrd_segment.sh
Executable file
13
tests/test-ocrd_segment.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
set -ex
|
||||
|
||||
test_id=`basename $0`
|
||||
cd `mktemp -d /tmp/$test_id-XXXXX`
|
||||
|
||||
# Prepare test workspace
|
||||
wget https://qurator-data.de/examples/actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
unzip actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
cd actevedef_718448162.first-page+binarization+segmentation
|
||||
|
||||
# Run tests
|
||||
ocrd-segment-extract-pages -I OCR-D-SEG-LINE-SBB -O TEST-OCRD-SEGMENT-EXTRACT-PAGES
|
20
tests/test-ocrd_tesserocr.sh
Executable file
20
tests/test-ocrd_tesserocr.sh
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh
|
||||
set -ex
|
||||
|
||||
test_id=`basename $0`
|
||||
cd `mktemp -d /tmp/$test_id-XXXXX`
|
||||
|
||||
# Prepare processors
|
||||
ocrd resmgr download ocrd-tesserocr-recognize eng.traineddata
|
||||
ocrd resmgr download ocrd-tesserocr-recognize osd.traineddata
|
||||
ocrd resmgr download ocrd-tesserocr-recognize Fraktur_GT4HistOCR.traineddata
|
||||
|
||||
# Prepare test workspace
|
||||
wget https://qurator-data.de/examples/actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
unzip actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
cd actevedef_718448162.first-page+binarization+segmentation
|
||||
|
||||
# Run tests
|
||||
ocrd-tesserocr-segment-region -I OCR-D-IMG-BIN -O TEST-TESS-SEG-REG
|
||||
ocrd-tesserocr-segment-line -I TEST-TESS-SEG-REG -O TEST-TESS-SEG-LINE
|
||||
ocrd-tesserocr-recognize -I TEST-TESS-SEG-LINE -O TEST-TESS-OCR -P model Fraktur_GT4HistOCR
|
17
tests/test-ocrd_trocr.sh
Executable file
17
tests/test-ocrd_trocr.sh
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
set -ex
|
||||
|
||||
test_id=`basename $0`
|
||||
cd `mktemp -d /tmp/$test_id-XXXXX`
|
||||
|
||||
# Prepare processors
|
||||
|
||||
# Prepare test workspace
|
||||
wget https://qurator-data.de/examples/actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
unzip actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
cd actevedef_718448162.first-page+binarization+segmentation
|
||||
|
||||
# Run tests
|
||||
ocrd-trocr-recognize -I OCR-D-SEG-LINE-SBB -O TEST-TROCR
|
||||
|
||||
# TODO Does not use a useful model, does not check that text was recognize
|
13
tests/test-ocrd_wrap.sh
Executable file
13
tests/test-ocrd_wrap.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
set -ex
|
||||
|
||||
test_id=`basename $0`
|
||||
cd `mktemp -d /tmp/$test_id-XXXXX`
|
||||
|
||||
# Prepare test workspace
|
||||
wget https://qurator-data.de/examples/actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
unzip actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
cd actevedef_718448162.first-page+binarization+segmentation
|
||||
|
||||
# Run tests
|
||||
ocrd-skimage-binarize -I OCR-D-IMG -O TEST-OCRD-SKIMAGE-BINARIZE
|
16
tests/test-sbb_binarization.sh
Executable file
16
tests/test-sbb_binarization.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
set -ex
|
||||
|
||||
test_id=`basename $0`
|
||||
cd `mktemp -d /tmp/$test_id-XXXXX`
|
||||
|
||||
# Prepare processors
|
||||
ocrd resmgr download ocrd-sbb-binarize default
|
||||
|
||||
# Prepare test workspace
|
||||
wget https://qurator-data.de/examples/actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
unzip actevedef_718448162.first-page+binarization+segmentation.zip
|
||||
cd actevedef_718448162.first-page+binarization+segmentation
|
||||
|
||||
# Run tests
|
||||
ocrd-sbb-binarize -P model default -I OCR-D-IMG -O TEST-OCRD-SBB-BINARIZE
|
Loading…
Add table
Add a link
Reference in a new issue