You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ocrd-galley/Dockerfile-ocrd_tesserocr

36 lines
1.1 KiB
Plaintext

FROM my_ocrd_workflow-core
ARG PIP_INSTALL="pip install --no-cache-dir"
ARG TESSDATA_BEST_VERSION="4.0.0"
ENV TESSDATA_PREFIX /usr/local/share/tessdata
# Install Leptonica and Tesseract.
RUN add-apt-repository ppa:alex-p/tesseract-ocr && \
apt-get update && \
apt-get install -y \
tesseract-ocr \
libtesseract-dev \
&& \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy OCR models
RUN mkdir -p $TESSDATA_PREFIX
ADD data/mirror/github.com/tesseract-ocr/tessdata_best/archive/${TESSDATA_BEST_VERSION}-repacked.tar.gz $TESSDATA_PREFIX/
COPY data/tesseract-models/GT4HistOCR/GT4HistOCR_2000000.traineddata $TESSDATA_PREFIX/
RUN curl -sSL -O https://ub-backup.bib.uni-mannheim.de/~stweil/ocrd-train/data/Fraktur_5000000/tessdata_fast/Fraktur_50000000.502_198857.traineddata && \
mv *.traineddata $TESSDATA_PREFIX/
# Build pip installable stuff
RUN ${PIP_INSTALL} \
'ocrd_tesserocr == 0.9.2' # XXX https://github.com/OCR-D/ocrd_tesserocr/issues/160
# Check pip dependencies
RUN pip check
# Default command
CMD ["ocrd-tesserocr-recognize"]