Skip to content

jahtz/sbbbin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

206 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SBB Binarization

Python Version License

Pixelwise image binarization with selectional auto-encoders.
This repository is a PyTorch-based adaptation of the original SBB Binarization code.

Credits

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.

Setup

Note

The setup process is configured for uv.

git clone https://github.com/jahtz/sbbbin
uv tool install ./sbbbin --torch-backend <backend>

See $ uv tool install --help for possible backends.

Usage

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

Model

The Tensorflow model can be downloaded huggingface.
To convert the model from Tensorflow to PyTorch, use sbb_binarizer_pytorch_converter.

ZPD

Developed at Centre for Philology and Digitality (ZPD), University of Würzburg.

About

Generate binary versions of input images using SBB binarization.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Python 100.0%