2019-03-11 22:54:33 +00:00
|
|
|
FROM debian:stretch-slim
|
2018-10-09 12:43:23 +00:00
|
|
|
|
|
|
|
MAINTAINER Patrick Jentsch <p.jentsch@uni-bielefeld.de>
|
|
|
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
2018-10-29 09:38:50 +00:00
|
|
|
ENV LANG=C.UTF-8
|
2018-10-09 12:43:23 +00:00
|
|
|
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y --no-install-recommends \
|
2018-10-29 09:38:50 +00:00
|
|
|
apt-transport-https \
|
|
|
|
ca-certificates \
|
|
|
|
gnupg2 \
|
2018-10-09 12:43:23 +00:00
|
|
|
imagemagick \
|
|
|
|
pdftk \
|
|
|
|
poppler-utils \
|
|
|
|
python2.7 \
|
2018-10-29 09:38:50 +00:00
|
|
|
python3.5 \
|
|
|
|
python-numpy \
|
2018-10-09 12:43:23 +00:00
|
|
|
wget
|
|
|
|
|
|
|
|
WORKDIR /root
|
|
|
|
|
2018-10-29 09:49:19 +00:00
|
|
|
# Install ocropy
|
|
|
|
ENV OCROPY_VERSION 1.3.3
|
|
|
|
RUN wget -nv https://github.com/tmbdev/ocropy/archive/v"$OCROPY_VERSION".tar.gz && \
|
|
|
|
tar -xzf v"$OCROPY_VERSION".tar.gz && \
|
|
|
|
rm v"$OCROPY_VERSION".tar.gz && \
|
|
|
|
cd ocropy-"$OCROPY_VERSION" && \
|
|
|
|
apt-get install -y --no-install-recommends $(cat PACKAGES) python-pil python-tk && \
|
|
|
|
wget -nv http://www.tmbdev.net/en-default.pyrnn.gz -P models/ && \
|
|
|
|
python2.7 setup.py install && \
|
|
|
|
cd ..
|
|
|
|
|
2018-10-09 12:43:23 +00:00
|
|
|
# Install pyFlow
|
2018-10-29 09:49:19 +00:00
|
|
|
ENV PYFLOW_VERSION 1.1.20
|
2018-10-29 09:38:50 +00:00
|
|
|
RUN wget -nv https://github.com/Illumina/pyflow/releases/download/v"$PYFLOW_VERSION"/pyflow-"$PYFLOW_VERSION".tar.gz && \
|
2018-10-09 12:43:23 +00:00
|
|
|
tar -xzf pyflow-"$PYFLOW_VERSION".tar.gz && \
|
2018-10-29 09:38:50 +00:00
|
|
|
rm pyflow-"$PYFLOW_VERSION".tar.gz && \
|
2018-10-09 12:43:23 +00:00
|
|
|
cd pyflow-"$PYFLOW_VERSION" && \
|
|
|
|
python2.7 setup.py build install && \
|
2018-10-29 09:38:50 +00:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
# Install Tesseract OCR and Data Files
|
|
|
|
RUN echo "deb https://notesalexp.org/tesseract-ocr/stretch/ stretch main" >> /etc/apt/sources.list && \
|
|
|
|
wget -O - https://notesalexp.org/debian/alexp_key.asc | apt-key add - && \
|
|
|
|
apt-get update && \
|
2019-04-24 15:01:49 +00:00
|
|
|
apt-get install -y --no-install-recommends \
|
2019-04-25 09:50:32 +00:00
|
|
|
tesseract-ocr && \
|
|
|
|
wget -nv https://github.com/tesseract-ocr/tessdata_best/raw/master/deu.traineddata -P /usr/share/tesseract-ocr/4.00/tessdata && \
|
|
|
|
wget -nv https://github.com/tesseract-ocr/tessdata/raw/master/deu_frak.traineddata -P /usr/share/tesseract-ocr/4.00/tessdata && \
|
|
|
|
wget -nv https://github.com/tesseract-ocr/tessdata_best/raw/master/eng.traineddata -P /usr/share/tesseract-ocr/4.00/tessdata && \
|
|
|
|
wget -nv https://github.com/tesseract-ocr/tessdata_best/raw/master/enm.traineddata -P /usr/share/tesseract-ocr/4.00/tessdata && \
|
|
|
|
wget -nv https://github.com/tesseract-ocr/tessdata_best/raw/master/fra.traineddata -P /usr/share/tesseract-ocr/4.00/tessdata && \
|
|
|
|
wget -nv https://github.com/tesseract-ocr/tessdata_best/raw/master/frm.traineddata -P /usr/share/tesseract-ocr/4.00/tessdata && \
|
|
|
|
wget -nv https://github.com/tesseract-ocr/tessdata_best/raw/master/por.traineddata -P /usr/share/tesseract-ocr/4.00/tessdata && \
|
|
|
|
wget -nv https://github.com/tesseract-ocr/tessdata_best/raw/master/spa.traineddata -P /usr/share/tesseract-ocr/4.00/tessdata
|
2018-10-29 09:38:50 +00:00
|
|
|
|
2019-03-10 19:59:30 +00:00
|
|
|
COPY ocr /usr/local/bin
|
2019-03-10 20:04:14 +00:00
|
|
|
COPY hocrtotei /usr/local/bin
|
2018-10-09 12:43:23 +00:00
|
|
|
|
2019-04-24 15:01:49 +00:00
|
|
|
CMD ["/bin/bash"]
|