diff --git a/.circleci/config.yml b/.circleci/config.yml index ca93957..8f02829 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,14 +9,13 @@ jobs: - checkout - restore_cache: keys: - - model-cache + - ocrd-resources-{{ checksum "requirements.txt" }}-{{ checksum "Makefile" }} + - run: make install - run: make model - save_cache: - key: model-cache + key: ocrd-resources-{{ checksum "requirements.txt" }}-{{ checksum "Makefile" }} paths: - models.tar.gz - models - - run: make install + ocrd-resources - run: git submodule update --init - run: make test @@ -27,14 +26,13 @@ jobs: - checkout - restore_cache: keys: - - model-cache + - ocrd-resources-{{ checksum "requirements.txt" }}-{{ checksum "Makefile" }} + - run: make install - run: make model - save_cache: - key: model-cache + key: ocrd-resources-{{ checksum "requirements.txt" }}-{{ checksum "Makefile" }} paths: - models.tar.gz - models - - run: make install + ocrd-resources - run: git submodule update --init - run: make test diff --git a/Makefile b/Makefile index 7d96752..8c44a32 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,3 @@ -# Directory to store models -MODEL_DIR = $(PWD)/models - # BEGIN-EVAL makefile-parser --make-help Makefile help: @@ -22,15 +19,11 @@ install: pip install . # Downloads the pre-trained models from qurator-data.de -model: $(MODEL_DIR)/model1_bin.h5 - -$(MODEL_DIR)/model1_bin.h5: models.tar.gz - tar xf models.tar.gz - -models.tar.gz: - wget 'https://qurator-data.de/sbb_binarization/models.tar.gz' +.PHONY: model +model: + ocrd resmgr download --allow-uninstalled --location cwd ocrd-sbb-binarize default # Run tests test: model - cd repo/assets/data/kant_aufklaerung_1784/data; ocrd-sbb-binarize -I OCR-D-IMG -O BIN -P model $(MODEL_DIR) - cd repo/assets/data/kant_aufklaerung_1784-page-region/data; ocrd-sbb-binarize -I OCR-D-IMG -O BIN -P model $(MODEL_DIR) -P operation_level region + cd repo/assets/data/kant_aufklaerung_1784/data; ocrd-sbb-binarize -I OCR-D-IMG -O BIN -P model default + cd repo/assets/data/kant_aufklaerung_1784-page-region/data; ocrd-sbb-binarize -I OCR-D-IMG -O BIN -P model default -P operation_level region