Code Monkey home page Code Monkey logo

docker-ocropy's Introduction

docker-ocropy

ocropy in a Docker container.

This is a simple way of getting an ocropy OCR system installed.

Run it

For convenience, this repo comes bundled with a shell script run-ocropy:

> ./run-ocropy --help
./run-ocropy [--help] [--sudo] [--image <image-name>] [--working-dir <working-dir>] <cmd> [args...]

  --sudo                      Run as sudo
  --image <image-name>        Use this image (Default: kbai/ocropy)
  --working-dir <working-dir> Mount this dir (Default: $PWD)
  <cmd>                       Execute this ocropy-<cmd> command
  [args...]                   Depend on the command. See ocropy docs.

Commands:  dewarp econf errs gpageseg gtedit hocr linegen lpred ltrain nlbin rpred rtrain results 

Run with docker command

You can run ocropy from the command line:

docker run -v `pwd`:/work kbai/ocropy /ocropy/ocropus-rpred *.png

This will:

  • Download the docker-ocropy container from Docker Hub
  • Mount pwd to the /work directory within the docker
  • Execute /ocropus/ocropy/ocropus-rpred from within the container
  • On all PNG images in the current dir (pwd) on this computer and hence /work in the container

See the Docker documentation to see how you need to use the -v flag and other flags.

You can also do training and all the other operations you'd normally run with an ocropy installation.

Train it

Use the ocrotrain.sh script to see how to train the engine:

docker run -v "$PWD:/work" kbai/ocropy ./ocrotrain.sh

This will download the uw3-100 dataset dataset and run ocropus-rtrain on it.

Build it

If you want to adapt the Dockerfile and rebuild the image, you can do so with

docker build [-t '<username>/<reponame>'] .

While optional for local use, choosing a username/reponame combo makes it easier to manage

docker-ocropy's People

Contributors

ddohler avatar kba avatar tmbdev avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.