From 94a035e2cf7c667cb6cf8d036decd3faad674881 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Tue, 16 Feb 2021 18:42:08 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20support=20for=20ocrd=5Fwrap?= =?UTF-8?q?=20aka=20ocrd-skimage-*?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.star | 1 + Dockerfile-ocrd_wrap | 18 ++++++++++++++++++ README-DEV.md | 3 ++- wrapper/qurator/ocrd_galley/cli.py | 5 +++++ 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 Dockerfile-ocrd_wrap diff --git a/.drone.star b/.drone.star index 541d732..1933371 100644 --- a/.drone.star +++ b/.drone.star @@ -35,6 +35,7 @@ def main(ctx): step_for(ctx, "ocrd_olena", tags), step_for(ctx, "ocrd_segment", tags), step_for(ctx, "ocrd_tesserocr", tags), + step_for(ctx, "ocrd_wrap", tags), step_for(ctx, "sbb_binarization", tags), step_for(ctx, "sbb_textline_detector", tags), { diff --git a/Dockerfile-ocrd_wrap b/Dockerfile-ocrd_wrap new file mode 100644 index 0000000..a6f8978 --- /dev/null +++ b/Dockerfile-ocrd_wrap @@ -0,0 +1,18 @@ +ARG DRONE_COMMIT="latest" +FROM quratorspk/ocrd-galley-core:$DRONE_COMMIT + +ARG PIP_INSTALL="pip install --no-cache-dir" +ARG OCRD_WRAP_VERSION="0.1.4" + + +# Build pip installable stuff +RUN ${PIP_INSTALL} \ + "ocrd_wrap == ${OCRD_WRAP_VERSION}" + + +# Check pip dependencies +RUN pip check + + +# Default command +CMD ["ocrd-preprocess-image"] diff --git a/README-DEV.md b/README-DEV.md index 675d7e7..21b6416 100644 --- a/README-DEV.md +++ b/README-DEV.md @@ -1,7 +1,8 @@ How to add a processor ---------------------- +* Add model download to `build` (if necessary) * Add a Dockerfile -* Add to `build` +* Add commands to `wrapper/qurator/ocrd_galley/cli.py` * Add to `.drone.star` Releasing diff --git a/wrapper/qurator/ocrd_galley/cli.py b/wrapper/qurator/ocrd_galley/cli.py index e43d0a8..5973b9e 100644 --- a/wrapper/qurator/ocrd_galley/cli.py +++ b/wrapper/qurator/ocrd_galley/cli.py @@ -35,6 +35,11 @@ sub_images = { "ocrd-segment-from-coco": "ocrd_segment", "ocrd-segment-repair": "ocrd_segment", "ocrd-segment-evaluate": "ocrd_segment", + "ocrd-preprocess-image": "ocrd_wrap", + "ocrd-skimage-normalize": "ocrd_wrap", + "ocrd-skimage-denoise-raw": "ocrd_wrap", + "ocrd-skimage-binarize": "ocrd_wrap", + "ocrd-skimage-denoise": "ocrd_wrap", }