mirror of
https://github.com/qurator-spk/eynollah.git
synced 2025-10-06 22:50:14 +02:00
Merge branch 'adapt-ocrd' of https://github.com/qurator-spk/eynollah into adapt-ocrd
This commit is contained in:
commit
f3f5426597
2 changed files with 16 additions and 14 deletions
5
Makefile
5
Makefile
|
@ -115,8 +115,9 @@ ocrd-test: tests/resources/kant_aufklaerung_1784_0020.tif
|
||||||
$(RM) -r $(TMPDIR)
|
$(RM) -r $(TMPDIR)
|
||||||
|
|
||||||
# Run unit tests
|
# Run unit tests
|
||||||
test: export EYNOLLAH_MODELS=$(CURDIR)/models_layout_v0_5_0
|
test: export MODELS_LAYOUT=$(CURDIR)/models_layout_v0_5_0
|
||||||
test: export SBBBIN_MODELS=$(CURDIR)/default-2021-03-09
|
test: export MODELS_OCR=$(CURDIR)/models_ocr_v0_5_0
|
||||||
|
test: export MODELS_BIN=$(CURDIR)/default-2021-03-09
|
||||||
test:
|
test:
|
||||||
$(PYTHON) -m pytest tests --durations=0 --continue-on-collection-errors $(PYTEST_ARGS)
|
$(PYTHON) -m pytest tests --durations=0 --continue-on-collection-errors $(PYTEST_ARGS)
|
||||||
|
|
||||||
|
|
|
@ -15,14 +15,15 @@ from ocrd_models.constants import NAMESPACES as NS
|
||||||
|
|
||||||
testdir = Path(__file__).parent.resolve()
|
testdir = Path(__file__).parent.resolve()
|
||||||
|
|
||||||
EYNOLLAH_MODELS = environ.get('EYNOLLAH_MODELS', str(testdir.joinpath('..', 'models_eynollah').resolve()))
|
MODELS_LAYOUT = environ.get('MODELS_LAYOUT', str(testdir.joinpath('..', 'models_layout_v0_5_0').resolve()))
|
||||||
SBBBIN_MODELS = environ.get('SBBBIN_MODELS', str(testdir.joinpath('..', 'default-2021-03-09').resolve()))
|
MODELS_OCR = environ.get('MODELS_OCR', str(testdir.joinpath('..', 'models_ocr_v0_5_0').resolve()))
|
||||||
|
MODELS_BIN = environ.get('MODELS_BIN', str(testdir.joinpath('..', 'default-2021-03-09').resolve()))
|
||||||
|
|
||||||
def test_run_eynollah_layout_filename(tmp_path, subtests, pytestconfig, caplog):
|
def test_run_eynollah_layout_filename(tmp_path, subtests, pytestconfig, caplog):
|
||||||
infile = testdir.joinpath('resources/kant_aufklaerung_1784_0020.tif')
|
infile = testdir.joinpath('resources/kant_aufklaerung_1784_0020.tif')
|
||||||
outfile = tmp_path / 'kant_aufklaerung_1784_0020.xml'
|
outfile = tmp_path / 'kant_aufklaerung_1784_0020.xml'
|
||||||
args = [
|
args = [
|
||||||
'-m', EYNOLLAH_MODELS,
|
'-m', MODELS_LAYOUT,
|
||||||
'-i', str(infile),
|
'-i', str(infile),
|
||||||
'-o', str(outfile.parent),
|
'-o', str(outfile.parent),
|
||||||
# subtests write to same location
|
# subtests write to same location
|
||||||
|
@ -66,7 +67,7 @@ def test_run_eynollah_layout_directory(tmp_path, pytestconfig, caplog):
|
||||||
indir = testdir.joinpath('resources')
|
indir = testdir.joinpath('resources')
|
||||||
outdir = tmp_path
|
outdir = tmp_path
|
||||||
args = [
|
args = [
|
||||||
'-m', EYNOLLAH_MODELS,
|
'-m', MODELS_LAYOUT,
|
||||||
'-di', str(indir),
|
'-di', str(indir),
|
||||||
'-o', str(outdir),
|
'-o', str(outdir),
|
||||||
]
|
]
|
||||||
|
@ -88,7 +89,7 @@ def test_run_eynollah_binarization_filename(tmp_path, subtests, pytestconfig, ca
|
||||||
infile = testdir.joinpath('resources/kant_aufklaerung_1784_0020.tif')
|
infile = testdir.joinpath('resources/kant_aufklaerung_1784_0020.tif')
|
||||||
outfile = tmp_path.joinpath('kant_aufklaerung_1784_0020.png')
|
outfile = tmp_path.joinpath('kant_aufklaerung_1784_0020.png')
|
||||||
args = [
|
args = [
|
||||||
'-m', SBBBIN_MODELS,
|
'-m', MODELS_BIN,
|
||||||
'-i', str(infile),
|
'-i', str(infile),
|
||||||
'-o', str(outfile),
|
'-o', str(outfile),
|
||||||
]
|
]
|
||||||
|
@ -120,7 +121,7 @@ def test_run_eynollah_binarization_directory(tmp_path, subtests, pytestconfig, c
|
||||||
indir = testdir.joinpath('resources')
|
indir = testdir.joinpath('resources')
|
||||||
outdir = tmp_path
|
outdir = tmp_path
|
||||||
args = [
|
args = [
|
||||||
'-m', SBBBIN_MODELS,
|
'-m', MODELS_BIN,
|
||||||
'-di', str(indir),
|
'-di', str(indir),
|
||||||
'-o', str(outdir),
|
'-o', str(outdir),
|
||||||
]
|
]
|
||||||
|
@ -141,7 +142,7 @@ def test_run_eynollah_enhancement_filename(tmp_path, subtests, pytestconfig, cap
|
||||||
infile = testdir.joinpath('resources/kant_aufklaerung_1784_0020.tif')
|
infile = testdir.joinpath('resources/kant_aufklaerung_1784_0020.tif')
|
||||||
outfile = tmp_path.joinpath('kant_aufklaerung_1784_0020.png')
|
outfile = tmp_path.joinpath('kant_aufklaerung_1784_0020.png')
|
||||||
args = [
|
args = [
|
||||||
'-m', EYNOLLAH_MODELS,
|
'-m', MODELS_LAYOUT,
|
||||||
'-i', str(infile),
|
'-i', str(infile),
|
||||||
'-o', str(outfile.parent),
|
'-o', str(outfile.parent),
|
||||||
# subtests write to same location
|
# subtests write to same location
|
||||||
|
@ -175,7 +176,7 @@ def test_run_eynollah_enhancement_directory(tmp_path, subtests, pytestconfig, ca
|
||||||
indir = testdir.joinpath('resources')
|
indir = testdir.joinpath('resources')
|
||||||
outdir = tmp_path
|
outdir = tmp_path
|
||||||
args = [
|
args = [
|
||||||
'-m', EYNOLLAH_MODELS,
|
'-m', MODELS_LAYOUT,
|
||||||
'-di', str(indir),
|
'-di', str(indir),
|
||||||
'-o', str(outdir),
|
'-o', str(outdir),
|
||||||
]
|
]
|
||||||
|
@ -196,7 +197,7 @@ def test_run_eynollah_mbreorder_filename(tmp_path, subtests, pytestconfig, caplo
|
||||||
infile = testdir.joinpath('resources/kant_aufklaerung_1784_0020.xml')
|
infile = testdir.joinpath('resources/kant_aufklaerung_1784_0020.xml')
|
||||||
outfile = tmp_path.joinpath('kant_aufklaerung_1784_0020.xml')
|
outfile = tmp_path.joinpath('kant_aufklaerung_1784_0020.xml')
|
||||||
args = [
|
args = [
|
||||||
'-m', EYNOLLAH_MODELS,
|
'-m', MODELS_LAYOUT,
|
||||||
'-i', str(infile),
|
'-i', str(infile),
|
||||||
'-o', str(outfile.parent),
|
'-o', str(outfile.parent),
|
||||||
]
|
]
|
||||||
|
@ -225,7 +226,7 @@ def test_run_eynollah_mbreorder_directory(tmp_path, subtests, pytestconfig, capl
|
||||||
indir = testdir.joinpath('resources')
|
indir = testdir.joinpath('resources')
|
||||||
outdir = tmp_path
|
outdir = tmp_path
|
||||||
args = [
|
args = [
|
||||||
'-m', EYNOLLAH_MODELS,
|
'-m', MODELS_LAYOUT,
|
||||||
'-di', str(indir),
|
'-di', str(indir),
|
||||||
'-o', str(outdir),
|
'-o', str(outdir),
|
||||||
]
|
]
|
||||||
|
@ -249,7 +250,7 @@ def test_run_eynollah_ocr_filename(tmp_path, subtests, pytestconfig, caplog):
|
||||||
outrenderfile = tmp_path.joinpath('render').joinpath('kant_aufklaerung_1784_0020.xml')
|
outrenderfile = tmp_path.joinpath('render').joinpath('kant_aufklaerung_1784_0020.xml')
|
||||||
outrenderfile.parent.mkdir()
|
outrenderfile.parent.mkdir()
|
||||||
args = [
|
args = [
|
||||||
'-m', EYNOLLAH_MODELS,
|
'-m', MODELS_OCR,
|
||||||
'-i', str(infile),
|
'-i', str(infile),
|
||||||
'-dx', str(infile.parent),
|
'-dx', str(infile.parent),
|
||||||
'-o', str(outfile.parent),
|
'-o', str(outfile.parent),
|
||||||
|
@ -289,7 +290,7 @@ def test_run_eynollah_ocr_directory(tmp_path, subtests, pytestconfig, caplog):
|
||||||
indir = testdir.joinpath('resources')
|
indir = testdir.joinpath('resources')
|
||||||
outdir = tmp_path
|
outdir = tmp_path
|
||||||
args = [
|
args = [
|
||||||
'-m', EYNOLLAH_MODELS,
|
'-m', MODELS_OCR,
|
||||||
'-di', str(indir),
|
'-di', str(indir),
|
||||||
'-dx', str(indir),
|
'-dx', str(indir),
|
||||||
'-o', str(outdir),
|
'-o', str(outdir),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue