⚙️ Get tessdata_best from git-annex/our mirror to make downloads more robust

pull/27/head
Gerber, Mike 4 years ago
parent 6ae31395a3
commit 72693071e0

@ -63,10 +63,7 @@ RUN pip3 install --no-cache-dir --upgrade pip && \
RUN mkdir -p /var/lib/calamari-models RUN mkdir -p /var/lib/calamari-models
COPY data/calamari-models/GT4HistOCR /var/lib/calamari-models/GT4HistOCR COPY data/calamari-models/GT4HistOCR /var/lib/calamari-models/GT4HistOCR
RUN mkdir -p $TESSDATA_PREFIX RUN mkdir -p $TESSDATA_PREFIX
RUN curl -sSL -O https://qurator-data.de/mirror/github.com/tesseract-ocr/tessdata_best/archive/$TESSDATA_BEST_VERSION.tar.gz && \ ADD data/mirror/github.com/tesseract-ocr/tessdata_best/archive/${TESSDATA_BEST_VERSION}-repacked.tar.gz $TESSDATA_PREFIX/
tar xzf $TESSDATA_BEST_VERSION.tar.gz && \
mv tessdata_best-$TESSDATA_BEST_VERSION/* $TESSDATA_PREFIX/ && \
rm -rf $TESSDATA_BEST_VERSION.tar.gz
COPY data/tesseract-models/GT4HistOCR/GT4HistOCR_2000000.traineddata $TESSDATA_PREFIX/ COPY data/tesseract-models/GT4HistOCR/GT4HistOCR_2000000.traineddata $TESSDATA_PREFIX/
COPY data/textline_detection /var/lib/textline_detection COPY data/textline_detection /var/lib/textline_detection

@ -9,11 +9,13 @@ get_from_annex() {
annex_get 'calamari-models/GT4HistOCR/2019-07-22T15_49+0200/*.ckpt*' annex_get 'calamari-models/GT4HistOCR/2019-07-22T15_49+0200/*.ckpt*'
annex_get 'tesseract-models/GT4HistOCR/*.traineddata' annex_get 'tesseract-models/GT4HistOCR/*.traineddata'
annex_get 'textline_detection/*.h5' annex_get 'textline_detection/*.h5'
annex_get 'mirror/github.com/tesseract-ocr/tessdata_best/archive/4.0.0-repacked.tar.gz'
} }
get_from_web() { get_from_web() {
download_to 'https://qurator-data.de/calamari-models/GT4HistOCR/model.tar.xz' 'calamari-models/GT4HistOCR/2019-07-22T15_49+0200' download_to 'https://qurator-data.de/calamari-models/GT4HistOCR/model.tar.xz' 'calamari-models/GT4HistOCR/2019-07-22T15_49+0200'
download_to 'https://qurator-data.de/tesseract-models/GT4HistOCR/models.tar' 'tesseract-models/GT4HistOCR' download_to 'https://qurator-data.de/tesseract-models/GT4HistOCR/models.tar' 'tesseract-models/GT4HistOCR'
download_to 'https://qurator-data.de/sbb_textline_detector/models.tar.gz' 'textline_detection' download_to 'https://qurator-data.de/sbb_textline_detector/models.tar.gz' 'textline_detection'
download_to --no-unpack 'https://qurator-data.de/mirror/github.com/tesseract-ocr/tessdata_best/archive/4.0.0-repacked.tar.gz' 'mirror/github.com/tesseract-ocr/tessdata_best/archive/'
} }
. $self_dir/qurator_data_lib.sh . $self_dir/qurator_data_lib.sh
handle_data handle_data

Loading…
Cancel
Save