├── Dockerfile ├── README.md ├── ocrotrain.sh ├── run-ocropus └── test.png /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04 2 | MAINTAINER Tom 3 | ENV DEBIAN_FRONTEND noninteractive 4 | 5 | RUN apt-get -qq update 6 | RUN apt-get -qq dist-upgrade 7 | RUN apt-get -qqy install build-essential g++ gdb swig2.0 mercurial scons 8 | RUN apt-get -qqy install curl python-scipy python-matplotlib python-tables firefox imagemagick python-opencv python-bs4 git 9 | RUN apt-get clean && rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* 10 | 11 | RUN git clone https://github.com/tmbdev/ocropy.git 12 | RUN (cd ocropy/models && curl -O http://www.tmbdev.net/en-default.pyrnn.gz) 13 | RUN (cd ocropy && sudo python setup.py install) 14 | ADD ocrotrain.sh ocropy/ocrotrain.sh 15 | VOLUME /work 16 | WORKDIR /work 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | docker-ocropus 2 | ============== 3 | 4 | OCRopus is a Docker container. 5 | 6 | This is a simple way of getting an OCRopus OCR system installed. 7 | 8 | You can run OCRopus with a command like: 9 | 10 | docker run -v `pwd`:/work tmbdev/ocropus /ocropus/ocropy/ocropus-rpred *.png 11 | 12 | You can also do training and all the other operations you'd normally run with an OCRopus installation. 13 | See the Docker documentation to see how you need to use the -v flag and other flags. 14 | -------------------------------------------------------------------------------- /ocrotrain.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if test -d uw3-100; then 3 | echo not downloading again 4 | else 5 | curl https://storage.googleapis.com/tmbdev-public/uw3-100.tgz | tar -zxf - 6 | fi 7 | export LANG=C.utf-8 8 | export PYTHONIOENCODING=utf-8 9 | /usr/bin/python -c 'import locale; print locale.getdefaultlocale(); print u"\u0411\n"' 10 | /ocropus/ocropy/ocropus-rtrain -o 'model-%03d' uw3-100/*/*.png 11 | -------------------------------------------------------------------------------- /run-ocropus: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sudo docker.io run -v `pwd`:/work ocropy /ocropus/ocropy/ocropus-rpred "$@" 3 | -------------------------------------------------------------------------------- /test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tmbarchive/docker-ocropus/57d561150d2cefa120c202b9cb4d5f3f7f8bed0b/test.png --------------------------------------------------------------------------------