mirror of
https://github.com/qurator-spk/eynollah.git
synced 2025-11-10 06:34:11 +01:00
make *test: fix paths
This commit is contained in:
parent
0bef6e297b
commit
e449dbab6d
2 changed files with 9 additions and 10 deletions
1
.github/workflows/test-eynollah.yml
vendored
1
.github/workflows/test-eynollah.yml
vendored
|
|
@ -70,7 +70,6 @@ jobs:
|
||||||
- name: Hard-upgrade torch for debugging
|
- name: Hard-upgrade torch for debugging
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade torch
|
python -m pip install --upgrade torch
|
||||||
find models_eynollah
|
|
||||||
|
|
||||||
- name: Test with pytest
|
- name: Test with pytest
|
||||||
run: make coverage PYTEST_ARGS="-vv --junitxml=pytest.xml"
|
run: make coverage PYTEST_ARGS="-vv --junitxml=pytest.xml"
|
||||||
|
|
|
||||||
18
Makefile
18
Makefile
|
|
@ -56,7 +56,7 @@ $(EYNOLLAH_MODELS_ZIP):
|
||||||
$(WGET) $@ $(EYNOLLAH_MODELS_URL)
|
$(WGET) $@ $(EYNOLLAH_MODELS_URL)
|
||||||
|
|
||||||
$(EYNOLLAH_MODELS_DIR): $(EYNOLLAH_MODELS_ZIP)
|
$(EYNOLLAH_MODELS_DIR): $(EYNOLLAH_MODELS_ZIP)
|
||||||
mkdir -p $@; cd $@; unzip ../$<
|
unzip $<
|
||||||
|
|
||||||
build:
|
build:
|
||||||
$(PIP) install build
|
$(PIP) install build
|
||||||
|
|
@ -76,22 +76,22 @@ deps-test:
|
||||||
smoke-test: TMPDIR != mktemp -d
|
smoke-test: TMPDIR != mktemp -d
|
||||||
smoke-test: tests/resources/kant_aufklaerung_1784_0020.tif
|
smoke-test: tests/resources/kant_aufklaerung_1784_0020.tif
|
||||||
# layout analysis:
|
# layout analysis:
|
||||||
eynollah layout -i $< -o $(TMPDIR) -m $(CURDIR)/$(SEG_MODELNAME)
|
eynollah layout -i $< -o $(TMPDIR) -m $(CURDIR)/models_eynollah
|
||||||
fgrep -q http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15 $(TMPDIR)/$(basename $(<F)).xml
|
fgrep -q http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15 $(TMPDIR)/$(basename $(<F)).xml
|
||||||
fgrep -c -e TextRegion -e ImageRegion -e SeparatorRegion $(TMPDIR)/$(basename $(<F)).xml
|
fgrep -c -e TextRegion -e ImageRegion -e SeparatorRegion $(TMPDIR)/$(basename $(<F)).xml
|
||||||
# layout, directory mode (skip one, add one):
|
# layout, directory mode (skip one, add one):
|
||||||
eynollah layout -di $(<D) -o $(TMPDIR) -m $(CURDIR)/$(SEG_MODELNAME)
|
eynollah layout -di $(<D) -o $(TMPDIR) -m $(CURDIR)/models_eynollah
|
||||||
test -s $(TMPDIR)/euler_rechenkunst01_1738_0025.xml
|
test -s $(TMPDIR)/euler_rechenkunst01_1738_0025.xml
|
||||||
# mbreorder, directory mode (overwrite):
|
# mbreorder, directory mode (overwrite):
|
||||||
eynollah machine-based-reading-order -di $(<D) -o $(TMPDIR) -m $(CURDIR)/$(SEG_MODELNAME)
|
eynollah machine-based-reading-order -di $(<D) -o $(TMPDIR) -m $(CURDIR)/$(SEG_MODELNAME)
|
||||||
fgrep -q http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15 $(TMPDIR)/$(basename $(<F)).xml
|
fgrep -q http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15 $(TMPDIR)/$(basename $(<F)).xml
|
||||||
fgrep -c -e RegionRefIndexed $(TMPDIR)/$(basename $(<F)).xml
|
fgrep -c -e RegionRefIndexed $(TMPDIR)/$(basename $(<F)).xml
|
||||||
# binarize:
|
# binarize:
|
||||||
eynollah binarization -m $(CURDIR)/$(BIN_MODELNAME) -i $< -o $(TMPDIR)/$(<F)
|
eynollah binarization -m $(CURDIR)/models_eynollah/eynollah-binarization_20210425 -i $< -o $(TMPDIR)/$(<F)
|
||||||
test -s $(TMPDIR)/$(<F)
|
test -s $(TMPDIR)/$(<F)
|
||||||
@set -x; test "$$(identify -format '%w %h' $<)" = "$$(identify -format '%w %h' $(TMPDIR)/$(<F))"
|
@set -x; test "$$(identify -format '%w %h' $<)" = "$$(identify -format '%w %h' $(TMPDIR)/$(<F))"
|
||||||
# enhance:
|
# enhance:
|
||||||
eynollah enhancement -m $(CURDIR)/$(SEG_MODELNAME) -sos -i $< -o $(TMPDIR) -O
|
eynollah enhancement -m $(CURDIR)/models_eynollah -sos -i $< -o $(TMPDIR) -O
|
||||||
test -s $(TMPDIR)/$(<F)
|
test -s $(TMPDIR)/$(<F)
|
||||||
@set -x; test "$$(identify -format '%w %h' $<)" = "$$(identify -format '%w %h' $(TMPDIR)/$(<F))"
|
@set -x; test "$$(identify -format '%w %h' $<)" = "$$(identify -format '%w %h' $(TMPDIR)/$(<F))"
|
||||||
$(RM) -r $(TMPDIR)
|
$(RM) -r $(TMPDIR)
|
||||||
|
|
@ -102,16 +102,16 @@ ocrd-test: tests/resources/kant_aufklaerung_1784_0020.tif
|
||||||
cp $< $(TMPDIR)
|
cp $< $(TMPDIR)
|
||||||
ocrd workspace -d $(TMPDIR) init
|
ocrd workspace -d $(TMPDIR) init
|
||||||
ocrd workspace -d $(TMPDIR) add -G OCR-D-IMG -g PHYS_0020 -i OCR-D-IMG_0020 $(<F)
|
ocrd workspace -d $(TMPDIR) add -G OCR-D-IMG -g PHYS_0020 -i OCR-D-IMG_0020 $(<F)
|
||||||
ocrd-eynollah-segment -w $(TMPDIR) -I OCR-D-IMG -O OCR-D-SEG -P models $(CURDIR)/$(SEG_MODELNAME)
|
ocrd-eynollah-segment -w $(TMPDIR) -I OCR-D-IMG -O OCR-D-SEG -P models $(CURDIR)/models_eynollah
|
||||||
result=$$(ocrd workspace -d $(TMPDIR) find -G OCR-D-SEG); \
|
result=$$(ocrd workspace -d $(TMPDIR) find -G OCR-D-SEG); \
|
||||||
fgrep -q http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15 $(TMPDIR)/$$result && \
|
fgrep -q http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15 $(TMPDIR)/$$result && \
|
||||||
fgrep -c -e TextRegion -e ImageRegion -e SeparatorRegion $(TMPDIR)/$$result
|
fgrep -c -e TextRegion -e ImageRegion -e SeparatorRegion $(TMPDIR)/$$result
|
||||||
ocrd-sbb-binarize -w $(TMPDIR) -I OCR-D-IMG -O OCR-D-BIN -P model $(CURDIR)/$(BIN_MODELNAME)
|
ocrd-sbb-binarize -w $(TMPDIR) -I OCR-D-IMG -O OCR-D-BIN -P model $(CURDIR)/models_eynollah/eynollah-binarization_20210425
|
||||||
ocrd-sbb-binarize -w $(TMPDIR) -I OCR-D-SEG -O OCR-D-SEG-BIN -P model $(CURDIR)/$(BIN_MODELNAME) -P operation_level region
|
ocrd-sbb-binarize -w $(TMPDIR) -I OCR-D-SEG -O OCR-D-SEG-BIN -P model $(CURDIR)/models_eynollah/eynollah-binarization_20210425 -P operation_level region
|
||||||
$(RM) -r $(TMPDIR)
|
$(RM) -r $(TMPDIR)
|
||||||
|
|
||||||
# Run unit tests
|
# Run unit tests
|
||||||
test: export EYNOLLAH_MODELS_DIR := $(CURDIR)/$(EYNOLLAH_MODELS_DIR)
|
test: export EYNOLLAH_MODELS_DIR := $(CURDIR)/models_eynollah
|
||||||
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)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue