No description
Find a file
2023-02-14 23:33:56 +00:00
.circleci use resmgr for model download 2021-01-28 14:09:18 +01:00
repo add assets subrepo 2020-10-15 17:31:47 +02:00
sbb_binarize adapt OCR-D wrapper 2023-02-14 23:33:56 +00:00
.gitignore 📦 v0.0.2 2020-10-23 17:09:54 +02:00
.gitkeep Add new directory, you can find corresponding models in qurator-data 2019-08-23 15:47:32 +02:00
.gitmodules add assets subrepo 2020-10-15 17:31:47 +02:00
CHANGELOG.md 📦 v0.0.11 2022-10-24 16:57:22 +02:00
LICENSE Add LICENSE 2019-12-10 16:40:44 +01:00
make.sh Add new file 2019-08-23 15:50:09 +02:00
Makefile fix test 2021-01-28 14:19:22 +01:00
ocrd-tool.json add ocrd-tool.json 2020-10-15 15:19:04 +02:00
README.md Merge branch 'master-upstream' 2022-11-22 16:10:22 +01:00
requirements.txt Merge branch 'master-upstream' 2022-11-22 16:10:22 +01:00
setup.py minimal CI setup 2020-10-16 13:52:44 +02:00

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/models/ 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"