Skip to main content

Pixelwise binarization with selectional auto-encoders in Keras

Project description

Binarization

Binarization for document images

Examples

Introduction

This tool performs document image binarization using a trained ResNet50-UNet model.

Installation

Clone the repository, enter it and run

pip install .

Models

Pre-trained models in HDF5 format can be downloaded from here:

https://qurator-data.de/sbb_binarization/

We also provide a Tensorflow saved_model via Huggingface:

https://huggingface.co/SBB/sbb_binarization

Usage

sbb_binarize \
  -m <path to directory containing model files \
  <input image> \
  <output image>

Images containing a lot of border noise (black pixels) should be cropped beforehand to improve the quality of results.

Example

sbb_binarize -m /path/to/model/ myimage.tif myimage-bin.tif

To use the OCR-D interface:

ocrd-sbb-binarize --overwrite -I INPUT_FILE_GRP -O OCR-D-IMG-BIN -P model "/var/lib/sbb_binarization"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sbb_binarization-0.0.11.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

sbb_binarization-0.0.11-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file sbb_binarization-0.0.11.tar.gz.

File metadata

  • Download URL: sbb_binarization-0.0.11.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.12

File hashes

Hashes for sbb_binarization-0.0.11.tar.gz
Algorithm Hash digest
SHA256 8ab867c9c8864872d58e1b749daa681acece74bef46a9fe26fc9c50dfb8c07f9
MD5 79a06950323effd65ed088acffd1dbff
BLAKE2b-256 271bd7f12eebb0c8375faa3b5983ca0416d5a14c8d1ff420c7d31b3b0e88c8e5

See more details on using hashes here.

File details

Details for the file sbb_binarization-0.0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for sbb_binarization-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 a6b81da7b1f73cbedd6fa9f9a51b3005ed869a3d82f9cc2a13cccf96d54af71e
MD5 af49088fda20cd0f7e28c119112088e0
BLAKE2b-256 477863e6ff02129c7803d751fdf94022a8f0604277eabc56de6804b90a92485d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page