From 280a8dabf0ea28f71faabea2b9a5604fd290c366 Mon Sep 17 00:00:00 2001 From: Konstantin Baierer Date: Thu, 22 Oct 2020 14:30:50 +0200 Subject: [PATCH 1/3] add qurator-spk/sbb_binarization --- .gitmodules | 3 +++ Makefile | 13 +++++++++++++ sbb_binarization | 1 + 3 files changed, 17 insertions(+) create mode 160000 sbb_binarization diff --git a/.gitmodules b/.gitmodules index 092083f5..7d061483 100644 --- a/.gitmodules +++ b/.gitmodules @@ -82,3 +82,6 @@ [submodule "ocrd_olahd_client"] path = ocrd_olahd_client url = https://github.com/OCR-D/ocrd_olahd_client.git +[submodule "sbb_binarization"] + path = sbb_binarization + url = https://github.com/qurator-spk/sbb_binarization diff --git a/Makefile b/Makefile index d1b7dfe1..32228fde 100644 --- a/Makefile +++ b/Makefile @@ -438,6 +438,19 @@ else endif endif +ifneq ($(findstring sbb_binarization, $(OCRD_MODULES)),) +OCRD_EXECUTABLES += $(SBB_BINARIZATION) +SBB_BINARIZATION := $(BIN)/ocrd-sbb-binarize +$(SBB_BINARIZATION): sbb_binarization $(BIN)/ocrd +ifeq (0,$(MAKELEVEL)) + $(MAKE) -B -o $< $(notdir $(SBB_BINARIZATION)) + $(call delegate_venv,$(SBB_BINARIZATION)) +$(SBB_BINARIZATION): VIRTUAL_ENV := $(SUB_VENV)/headless-tf1 +else + $(pip_install) +endif +endif + ifneq ($(findstring sbb_textline_detector, $(OCRD_MODULES)),) OCRD_EXECUTABLES += $(SBB_LINE_DETECTOR) SBB_LINE_DETECTOR := $(BIN)/ocrd-sbb-textline-detector diff --git a/sbb_binarization b/sbb_binarization new file mode 160000 index 00000000..3e60a624 --- /dev/null +++ b/sbb_binarization @@ -0,0 +1 @@ +Subproject commit 3e60a62469622561a86f2be4167a1e69c66ae2a7 From 5d2f18db1043a3dd6c23aabc8f3fddd2222b8ec6 Mon Sep 17 00:00:00 2001 From: Konstantin Baierer Date: Thu, 22 Oct 2020 14:40:04 +0200 Subject: [PATCH 2/3] Use .git submodule URL for sbb_binarization Co-authored-by: Stefan Weil --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 7d061483..da24b1c3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -84,4 +84,4 @@ url = https://github.com/OCR-D/ocrd_olahd_client.git [submodule "sbb_binarization"] path = sbb_binarization - url = https://github.com/qurator-spk/sbb_binarization + url = https://github.com/qurator-spk/sbb_binarization.git From 32285fad55d3a7011a560f6f66c4559ee7e5f8d0 Mon Sep 17 00:00:00 2001 From: Konstantin Baierer Date: Thu, 22 Oct 2020 17:11:29 +0200 Subject: [PATCH 3/3] make install-models-sbb-binarization to download pretrained models --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 32228fde..ce1fe961 100644 --- a/Makefile +++ b/Makefile @@ -589,6 +589,7 @@ stripdir = $(patsubst %/,%,$(dir $(1))) install-models: \ install-models-tesseract \ install-models-ocropus \ + install-models-sbb-binarization \ install-models-calamari UB_MANNHEIM_BACKUP_URL = https://ub-backup.bib.uni-mannheim.de/~stweil/ocrd-train/data @@ -650,6 +651,13 @@ $(OCROPUS_DATA_PATH)/LatinHist-98000.pyrnn.gz: mkdir -p $(dir $@) $(call WGET,$@,https://github.com/chreul/OCR_Testdata_EarlyPrintedBooks/raw/master/LatinHist-98000.pyrnn.gz) +SBB_BINARIZATION_DATA_PATH := $(VIRTUAL_ENV)/share/sbb_binarization +.PHONY: install-models-sbb-binarization +install-models-sbb-binarization: + $(call WGET,/tmp/sbb_binarization_models.tar.gz,https://qurator-data.de/sbb_binarization/models.tar.gz) + cd $(SBB_BINARIZATION_DATA_PATH) && tar xf /tmp/sbb_binarization_models.tar.gz + rm /tmp/sbb_binarization_models.tar.gz + CALAMARI_DATA_PATH := $(VIRTUAL_ENV)/share/calamari .PHONY: install-models-calamari install-models-calamari: \