Skip to content

Commit

Permalink
Merge pull request #214 from OCR-D/add-sbb-binarization
Browse files Browse the repository at this point in the history
add qurator-spk/sbb_binarization
  • Loading branch information
kba authored Oct 22, 2020
2 parents a6aa8bb + 32285fa commit 846a624
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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.git
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -576,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
Expand Down Expand Up @@ -637,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: \
Expand Down
1 change: 1 addition & 0 deletions sbb_binarization
Submodule sbb_binarization added at 3e60a6

0 comments on commit 846a624

Please sign in to comment.