From ab358f7784d33f8200f3d21ce0774e4ba7aa4607 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 5 Dec 2019 18:48:02 +0100 Subject: [PATCH] calamari-models/train-calamari-gt4histocr: Add a script to prepare upload --- upload-prepare.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 upload-prepare.sh diff --git a/upload-prepare.sh b/upload-prepare.sh new file mode 100755 index 0000000..86a2ccd --- /dev/null +++ b/upload-prepare.sh @@ -0,0 +1,37 @@ +#!/bin/sh +# Upload GT4HistOCR Calamari model + +set -e + +self=`realpath $0` +self_dir=`dirname "$self"` + + + + +cd $self_dir +DATA_SUBDIR=data +get_from_annex() { + annex_get 'calamari-models/GT4HistOCR*' +} +. $self_dir/qurator_data_lib.sh +handle_data --no-download + + + + + +# Pack it up +( + cd $DATA_SUBDIR/calamari-models/GT4HistOCR + + if [ `ls train*log* | wc -l` != '1' ]; then + echo "More than one training log, clean up?"; exit 1 + fi + LOG_SRC=`ls train*log*` + LOG="$self_dir/$LOG_SRC.xz" + xz --verbose --compress --stdout "$LOG_SRC" >"$LOG" + + TAR="$self_dir/model.tar.xz" + tar --dereference --exclude='train*log*' -cav -f "$TAR" ./ +)