diff --git a/Dockerfile b/Dockerfile index b69b9a6..8b8b7e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -79,4 +79,4 @@ COPY xsd/* /usr/share/xml/ WORKDIR /data -CMD ["/usr/bin/my_ocrd_workflow"] +ENTRYPOINT ["/usr/bin/my_ocrd_workflow"] diff --git a/my_ocrd_workflow b/my_ocrd_workflow index 5522fdf..9d380cd 100755 --- a/my_ocrd_workflow +++ b/my_ocrd_workflow @@ -6,6 +6,19 @@ set -e # Abort on error export LOG_LEVEL=${LOG_LEVEL:-DEBUG} # /etc/ocrd_logging.py uses this to set level for all OCR-D modules export TEXTEQUIV_LEVEL=glyph +# Command line parameters +OPTS=`getopt -o I: --long input-file-grp: -- "$@"` +eval set -- "$OPTS" +INPUT_FILE_GRP=OCR-D-IMG +while true; do + case "$1" in + -I|--input-file-grp) INPUT_FILE_GRP=$2; shift 2;; + + --) shift; break;; + *) break;; + esac +done + # Set up logging if [ "$LOG_LEVEL" = "DEBUG" -o "$LOG_LEVEL" = "TRACE" ]; then set -x @@ -44,7 +57,7 @@ do_binarization() { }' ocrd workspace remove-group -rf OCR-D-IMG-BINPAGE ocrd workspace remove-group -rf OCR-D-IMG-BIN - ocrd-olena-binarize -I OCR-D-IMG -O OCR-D-IMG-BINPAGE,OCR-D-IMG-BIN -p "$ocrd_olena_binarize_parameters" + ocrd-olena-binarize -I $INPUT_FILE_GRP -O OCR-D-IMG-BINPAGE,OCR-D-IMG-BIN -p "$ocrd_olena_binarize_parameters" } do_linesegmentation_tesserocr() { diff --git a/run b/run index d47dd52..14277a2 100755 --- a/run +++ b/run @@ -19,4 +19,4 @@ docker run --privileged=true --rm -t \ --mount type=bind,src="$(pwd)",target=/data \ \ -e LOG_LEVEL=$LOG_LEVEL \ - $DOCKER_IMAGE + $DOCKER_IMAGE "$@" diff --git a/run-docker-hub b/run-docker-hub index 9076c93..9e4339e 100755 --- a/run-docker-hub +++ b/run-docker-hub @@ -1,4 +1,4 @@ #!/bin/sh # Run the my_ocrd_workflow container on the current workspace -DOCKER_IMAGE=mikegerber/my_ocrd_workflow:stable `dirname $0`/run +DOCKER_IMAGE=mikegerber/my_ocrd_workflow:stable `dirname $0`/run "$@"