Pixelwise image binarization with selectional auto-encoders.
This repository is a PyTorch-based adaptation of the original SBB Binarization code.
This repository is a fork of sbb_binarization.
Parts of that project were later integrated into eynollah, which also influenced this codebase.
Additionally, this repository includes code from sbb_binarizer_pytorch_converter to provide a PyTorch-based implementation.
Note
The setup process is configured for uv.
git clone https://github.com/jahtz/sbbbinuv tool install ./sbbbin --torch-backend <backend>See $ uv tool install --help for possible backends.
sbbbin [OPTIONS] IMAGES...$ sbbbin --help
Usage: sbbbin [OPTIONS] IMAGES...
Pixelwise binarization with selectional auto-encoders using the SBB
binarization algorithm
IMAGES: List of image file paths to process.
Options:
--help Show this message and exit.
--version Show the version and exit.
-m, --model FILE Path to the trained PyTorch (.pth) model.
[required]
-o, --output DIRECTORY Specify output directory for processed
files. Defaults to the parent directory of
each input file.
-s, --suffix TEXT Specify suffix for output images. [default:
.sbb.bin.png]
-d, --device [auto|cpu|cuda] Select the computing device. "cuda" requires
a bundled CUDA/PyTorch version. [default:
auto]
--logging [ERROR|WARNING|INFO] Set logging level. [default: ERROR]
Developed at Centre for Philology and Digitality (ZPD), University of
Würzburg
The Tensorflow model can be downloaded huggingface.
To convert the model from Tensorflow to PyTorch, use sbb_binarizer_pytorch_converter.
Developed at Centre for Philology and Digitality (ZPD), University of Würzburg.