Code Monkey home page Code Monkey logo

binarization_2017's Introduction

Binarization

This repo contains the code and models described in Document Image Binarization with Fully Convolutional Neural Networks. There are two sets of 5 models. One trained on DIBCO images, and the other trained on Palm Leaf Manuscripts (PML). Additional info on these models can be found here. You may also be interested in my submission to the DIBCO 2017 competition, located here.

This code depends on a number of python libraries: numpy, scipy, cv2 (python wrapper for opencv), and caffe (my custom fork).

Docker

For those who don't want to install the dependencies, I have created a docker image to run this code. You must have the nvidia-docker plugin installed to use it though you can still run our models on CPU (not recommended).

The usage for the docker container is

nvidia-docker run -v $HOST_WORK_DIRECTORY:/data tensmeyerc/icdar2017:binarization_gpu python binarize_dibco.py /data/input_file.jpg /data/output_file.png $DEVICE_ID
nvidia-docker run -v $HOST_WORK_DIRECTORY:/data tensmeyerc/icdar2017:binarization_gpu python binarize_plm.py /data/input_file.jpg /data/output_file.png $DEVICE_ID

$HOST_WORK_DIRECTORY is a directory on your machine that is mounted on /data inside of the docker container (using -v). It's the only way to expose images to the docker container. $DEVICE_ID is the ID of the GPU you want to use (typically 0). If omitted, then the models are run in CPU mode. There is no need to download the containers ahead of time. If you have docker and nvidia-docker installed, running the above commands will pull the docker image (~2GB) if it has not been previously pulled.

For some reason, the docker image gives a error (related to CuDNN) for binarize_plm.py with all 5 models, so the image was created using only 4 of the models (differeces should be negligible).

Citation

If you find this code useful to your research, please cite our paper:

@inproceedings{tensmeyer2017_binarization,
  title={Document Image Binarization with Fully Convolutional Neural Networks},
  author={Tensmeyer, Chris and Martinez, Tony},
  booktitle={ICDAR},
  year={2017},
  organization={IEEE}
}

binarization_2017's People

Contributors

ctensmeyer avatar

Watchers

James Cloos 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.