mirror of
https://github.com/qurator-spk/sbb_binarization.git
synced 2025-07-15 13:59:52 +02:00
use resmgr for model download
This commit is contained in:
parent
c46d5d8b9c
commit
fc6baf5897
2 changed files with 13 additions and 22 deletions
|
@ -9,14 +9,13 @@ jobs:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- model-cache
|
- ocrd-resources-{{ checksum "requirements.txt" }}-{{ checksum "Makefile" }}
|
||||||
|
- run: make install
|
||||||
- run: make model
|
- run: make model
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: model-cache
|
key: ocrd-resources-{{ checksum "requirements.txt" }}-{{ checksum "Makefile" }}
|
||||||
paths:
|
paths:
|
||||||
models.tar.gz
|
ocrd-resources
|
||||||
models
|
|
||||||
- run: make install
|
|
||||||
- run: git submodule update --init
|
- run: git submodule update --init
|
||||||
- run: make test
|
- run: make test
|
||||||
|
|
||||||
|
@ -27,14 +26,13 @@ jobs:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- model-cache
|
- ocrd-resources-{{ checksum "requirements.txt" }}-{{ checksum "Makefile" }}
|
||||||
|
- run: make install
|
||||||
- run: make model
|
- run: make model
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: model-cache
|
key: ocrd-resources-{{ checksum "requirements.txt" }}-{{ checksum "Makefile" }}
|
||||||
paths:
|
paths:
|
||||||
models.tar.gz
|
ocrd-resources
|
||||||
models
|
|
||||||
- run: make install
|
|
||||||
- run: git submodule update --init
|
- run: git submodule update --init
|
||||||
- run: make test
|
- run: make test
|
||||||
|
|
||||||
|
|
17
Makefile
17
Makefile
|
@ -1,6 +1,3 @@
|
||||||
# Directory to store models
|
|
||||||
MODEL_DIR = $(PWD)/models
|
|
||||||
|
|
||||||
# BEGIN-EVAL makefile-parser --make-help Makefile
|
# BEGIN-EVAL makefile-parser --make-help Makefile
|
||||||
|
|
||||||
help:
|
help:
|
||||||
|
@ -22,15 +19,11 @@ install:
|
||||||
pip install .
|
pip install .
|
||||||
|
|
||||||
# Downloads the pre-trained models from qurator-data.de
|
# Downloads the pre-trained models from qurator-data.de
|
||||||
model: $(MODEL_DIR)/model1_bin.h5
|
.PHONY: model
|
||||||
|
model:
|
||||||
$(MODEL_DIR)/model1_bin.h5: models.tar.gz
|
ocrd resmgr download --allow-uninstalled --location cwd ocrd-sbb-binarize default
|
||||||
tar xf models.tar.gz
|
|
||||||
|
|
||||||
models.tar.gz:
|
|
||||||
wget 'https://qurator-data.de/sbb_binarization/models.tar.gz'
|
|
||||||
|
|
||||||
# Run tests
|
# Run tests
|
||||||
test: model
|
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/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 $(MODEL_DIR) -P operation_level region
|
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue