Support --input-file-grp/-I command line parameter

pull/27/head
Gerber, Mike 5 years ago
parent 9e80926eb2
commit 78f632a523

@ -79,4 +79,4 @@ COPY xsd/* /usr/share/xml/
WORKDIR /data WORKDIR /data
CMD ["/usr/bin/my_ocrd_workflow"] ENTRYPOINT ["/usr/bin/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 LOG_LEVEL=${LOG_LEVEL:-DEBUG} # /etc/ocrd_logging.py uses this to set level for all OCR-D modules
export TEXTEQUIV_LEVEL=glyph 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 # Set up logging
if [ "$LOG_LEVEL" = "DEBUG" -o "$LOG_LEVEL" = "TRACE" ]; then if [ "$LOG_LEVEL" = "DEBUG" -o "$LOG_LEVEL" = "TRACE" ]; then
set -x 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-BINPAGE
ocrd workspace remove-group -rf OCR-D-IMG-BIN 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() { do_linesegmentation_tesserocr() {

2
run

@ -19,4 +19,4 @@ docker run --privileged=true --rm -t \
--mount type=bind,src="$(pwd)",target=/data \ --mount type=bind,src="$(pwd)",target=/data \
\ \
-e LOG_LEVEL=$LOG_LEVEL \ -e LOG_LEVEL=$LOG_LEVEL \
$DOCKER_IMAGE $DOCKER_IMAGE "$@"

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
# Run the my_ocrd_workflow container on the current workspace # 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 "$@"

Loading…
Cancel
Save