PYTHON ?= python3 PIP ?= pip3 EXTRAS ?= # DOCKER_BASE_IMAGE = artefakt.dev.sbb.berlin:5000/sbb/ocrd_core:v2.68.0 DOCKER_BASE_IMAGE ?= docker.io/ocrd/core-cuda-tf2:latest DOCKER_TAG ?= ocrd/eynollah DOCKER ?= docker WGET = wget -O #SEG_MODEL := https://qurator-data.de/eynollah/2021-04-25/models_eynollah.tar.gz #SEG_MODEL := https://qurator-data.de/eynollah/2022-04-05/models_eynollah_renamed.tar.gz # SEG_MODEL := https://qurator-data.de/eynollah/2022-04-05/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://zenodo.org/records/17194824/files/models_layout_v0_5_0.tar.gz?download=1 EYNOLLAH_MODELS_URL := https://zenodo.org/records/17417471/files/models_all_v0_7_0.zip EYNOLLAH_MODELS_ZIP = $(notdir $(EYNOLLAH_MODELS_URL)) EYNOLLAH_MODELS_DIR = $(EYNOLLAH_MODELS_ZIP:%.zip=%) PYTEST_ARGS ?= -vv --isolate # BEGIN-EVAL makefile-parser --make-help Makefile help: @echo "" @echo " Targets" @echo "" @echo " docker Build Docker image" @echo " build Build Python source and binary distribution" @echo " install Install package with pip" @echo " install-dev Install editable with pip" @echo " deps-test Install test dependencies with pip" @echo " models Download and extract models to $(CURDIR):" @echo " $(EYNOLLAH_MODELS_DIR)" @echo " smoke-test Run simple CLI check" @echo " ocrd-test Run OCR-D CLI check" @echo " test Run unit tests" @echo "" @echo " Variables" @echo " EXTRAS comma-separated list of features (like 'OCR,plotting') for 'install' [$(EXTRAS)]" @echo " DOCKER_TAG Docker image tag for 'docker' [$(DOCKER_TAG)]" @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 " ALL_MODELS URL of archive of all models [$(ALL_MODELS)]" @echo "" # END-EVAL # Download and extract models to $(PWD)/models_layout_v0_6_0 models: $(EYNOLLAH_MODELS_DIR) # do not download these files if we already have the directories .INTERMEDIATE: $(EYNOLLAH_MODELS_ZIP) $(EYNOLLAH_MODELS_ZIP): $(WGET) $@ $(EYNOLLAH_MODELS_URL) $(EYNOLLAH_MODELS_DIR): $(EYNOLLAH_MODELS_ZIP) unzip $< build: $(PIP) install build $(PYTHON) -m build . # Install with pip install: $(PIP) install .$(and $(EXTRAS),[$(EXTRAS)]) # Install editable with pip install-dev: $(PIP) install -e .$(and $(EXTRAS),[$(EXTRAS)]) deps-test: $(EYNOLLAH_MODELS_ZIP) $(PIP) install -r requirements-test.txt smoke-test: TMPDIR != mktemp -d smoke-test: tests/resources/kant_aufklaerung_1784_0020.tif # layout analysis: eynollah layout -i $< -o $(TMPDIR) -m $(CURDIR)/$(SEG_MODELNAME) fgrep -q http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15 $(TMPDIR)/$(basename $(