mirror of
https://github.com/qurator-spk/eynollah.git
synced 2025-10-07 06:59:58 +02:00
makefile: update model URL
This commit is contained in:
parent
61b20cc83d
commit
a3d8197930
1 changed files with 28 additions and 22 deletions
50
Makefile
50
Makefile
|
@ -13,10 +13,16 @@ DOCKER ?= docker
|
||||||
#SEG_MODEL := https://github.com/qurator-spk/eynollah/releases/download/v0.3.0/models_eynollah.tar.gz
|
#SEG_MODEL := https://github.com/qurator-spk/eynollah/releases/download/v0.3.0/models_eynollah.tar.gz
|
||||||
#SEG_MODEL := https://github.com/qurator-spk/eynollah/releases/download/v0.3.1/models_eynollah.tar.gz
|
#SEG_MODEL := https://github.com/qurator-spk/eynollah/releases/download/v0.3.1/models_eynollah.tar.gz
|
||||||
SEG_MODEL := https://zenodo.org/records/17194824/files/models_layout_v0_5_0.tar.gz?download=1
|
SEG_MODEL := https://zenodo.org/records/17194824/files/models_layout_v0_5_0.tar.gz?download=1
|
||||||
|
SEG_MODELFILE = $(notdir $(patsubst %?download=1,%,$(SEG_MODEL)))
|
||||||
|
SEG_MODELNAME = $(SEG_MODELFILE:%.tar.gz=%)
|
||||||
|
|
||||||
BIN_MODEL := https://github.com/qurator-spk/sbb_binarization/releases/download/v0.0.11/saved_model_2021_03_09.zip
|
BIN_MODEL := https://github.com/qurator-spk/sbb_binarization/releases/download/v0.0.11/saved_model_2021_03_09.zip
|
||||||
|
BIN_MODELFILE = $(notdir $(BIN_MODEL))
|
||||||
|
BIN_MODELNAME := default-2021-03-09
|
||||||
|
|
||||||
OCR_MODEL := https://zenodo.org/records/17194824/files/models_ocr_v0_5_0.tar.gz?download=1
|
OCR_MODEL := https://zenodo.org/records/17236998/files/models_ocr_v0_5_1.tar.gz?download=1
|
||||||
|
OCR_MODELFILE = $(notdir $(patsubst %?download=1,%,$(OCR_MODEL)))
|
||||||
|
OCR_MODELNAME = $(OCR_MODELFILE:%.tar.gz=%)
|
||||||
|
|
||||||
PYTEST_ARGS ?= -vv --isolate
|
PYTEST_ARGS ?= -vv --isolate
|
||||||
|
|
||||||
|
@ -31,7 +37,8 @@ help:
|
||||||
@echo " install Install package with pip"
|
@echo " install Install package with pip"
|
||||||
@echo " install-dev Install editable with pip"
|
@echo " install-dev Install editable with pip"
|
||||||
@echo " deps-test Install test dependencies with pip"
|
@echo " deps-test Install test dependencies with pip"
|
||||||
@echo " models Download and extract models to $(CURDIR)/models_layout_v0_5_0"
|
@echo " models Download and extract models to $(CURDIR):"
|
||||||
|
@echo " $(BIN_MODELNAME) $(SEG_MODELNAME) $(OCR_MODELNAME)"
|
||||||
@echo " smoke-test Run simple CLI check"
|
@echo " smoke-test Run simple CLI check"
|
||||||
@echo " ocrd-test Run OCR-D CLI check"
|
@echo " ocrd-test Run OCR-D CLI check"
|
||||||
@echo " test Run unit tests"
|
@echo " test Run unit tests"
|
||||||
|
@ -42,33 +49,29 @@ help:
|
||||||
@echo " PYTEST_ARGS pytest args for 'test' (Set to '-s' to see log output during test execution, '-vv' to see individual tests. [$(PYTEST_ARGS)]"
|
@echo " PYTEST_ARGS pytest args for 'test' (Set to '-s' to see log output during test execution, '-vv' to see individual tests. [$(PYTEST_ARGS)]"
|
||||||
@echo " SEG_MODEL URL of 'models' archive to download for segmentation 'test' [$(SEG_MODEL)]"
|
@echo " SEG_MODEL URL of 'models' archive to download for segmentation 'test' [$(SEG_MODEL)]"
|
||||||
@echo " BIN_MODEL URL of 'models' archive to download for binarization 'test' [$(BIN_MODEL)]"
|
@echo " BIN_MODEL URL of 'models' archive to download for binarization 'test' [$(BIN_MODEL)]"
|
||||||
|
@echo " OCR_MODEL URL of 'models' archive to download for binarization 'test' [$(OCR_MODEL)]"
|
||||||
@echo ""
|
@echo ""
|
||||||
|
|
||||||
# END-EVAL
|
# END-EVAL
|
||||||
|
|
||||||
|
|
||||||
# Download and extract models to $(PWD)/models_layout_v0_5_0
|
# Download and extract models to $(PWD)/models_layout_v0_5_0
|
||||||
models: models_layout_v0_5_0 models_ocr_v0_5_0 default-2021-03-09
|
models: $(BIN_MODELNAME) $(SEG_MODELNAME) $(OCR_MODELNAME)
|
||||||
|
|
||||||
models_layout_v0_5_0: models_layout_v0_5_0.tar.gz
|
$(BIN_MODELFILE):
|
||||||
tar zxf models_layout_v0_5_0.tar.gz
|
wget -O $@ $(BIN_MODEL)
|
||||||
|
$(SEG_MODELFILE):
|
||||||
models_layout_v0_5_0.tar.gz:
|
|
||||||
wget -O $@ $(SEG_MODEL)
|
wget -O $@ $(SEG_MODEL)
|
||||||
|
$(OCR_MODELFILE):
|
||||||
models_ocr_v0_5_0: models_ocr_v0_5_0.tar.gz
|
|
||||||
tar zxf models_ocr_v0_5_0.tar.gz
|
|
||||||
|
|
||||||
models_ocr_v0_5_0.tar.gz:
|
|
||||||
wget -O $@ $(OCR_MODEL)
|
wget -O $@ $(OCR_MODEL)
|
||||||
|
|
||||||
default-2021-03-09: $(notdir $(BIN_MODEL))
|
$(BIN_MODELNAME): $(BIN_MODELFILE)
|
||||||
unzip $(notdir $(BIN_MODEL))
|
|
||||||
mkdir $@
|
mkdir $@
|
||||||
mv $(basename $(notdir $(BIN_MODEL))) $@
|
unzip -d $@ $<
|
||||||
|
$(SEG_MODELNAME): $(SEG_MODELFILE)
|
||||||
$(notdir $(BIN_MODEL)):
|
tar zxf $<
|
||||||
wget $(BIN_MODEL)
|
$(OCR_MODELNAME): $(OCR_MODELFILE)
|
||||||
|
tar zxf $<
|
||||||
|
|
||||||
build:
|
build:
|
||||||
$(PIP) install build
|
$(PIP) install build
|
||||||
|
@ -82,7 +85,10 @@ install:
|
||||||
install-dev:
|
install-dev:
|
||||||
$(PIP) install -e .$(and $(EXTRAS),[$(EXTRAS)])
|
$(PIP) install -e .$(and $(EXTRAS),[$(EXTRAS)])
|
||||||
|
|
||||||
deps-test: models_layout_v0_5_0
|
ifeq (OCR,$(findstring OCR, $(EXTRAS)))
|
||||||
|
deps-test: $(OCR_MODELNAME)
|
||||||
|
endif
|
||||||
|
deps-test: $(BIN_MODELNAME) $(SEG_MODELNAME)
|
||||||
$(PIP) install -r requirements-test.txt
|
$(PIP) install -r requirements-test.txt
|
||||||
|
|
||||||
smoke-test: TMPDIR != mktemp -d
|
smoke-test: TMPDIR != mktemp -d
|
||||||
|
@ -123,9 +129,9 @@ ocrd-test: tests/resources/kant_aufklaerung_1784_0020.tif
|
||||||
$(RM) -r $(TMPDIR)
|
$(RM) -r $(TMPDIR)
|
||||||
|
|
||||||
# Run unit tests
|
# Run unit tests
|
||||||
test: export MODELS_LAYOUT=$(CURDIR)/models_layout_v0_5_0
|
test: export MODELS_LAYOUT=$(CURDIR)/$(SEG_MODELNAME)
|
||||||
test: export MODELS_OCR=$(CURDIR)/models_ocr_v0_5_0
|
test: export MODELS_OCR=$(CURDIR)/$(OCR_MODELNAME)
|
||||||
test: export MODELS_BIN=$(CURDIR)/default-2021-03-09
|
test: export MODELS_BIN=$(CURDIR)/$(BIN_MODELNAME)
|
||||||
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