Repository navigation
kraken 7.2
Highlights
- New default BLLA segmentation model. It was retrained with the compound loss on a larger dataset of 11,200 pages, which adds print, photos from handheld devices and non-Latin scripts (mostly Arabic). The model card is at https://zenodo.org/records/22879549.
- Faster baseline segmentation and polygonization. The Sato filter is now truncated and parallelized, and there is a torch version for GPUs using convolutions. Region boundary tracing is about 10x faster, and ROI calculation and line rotation are significantly faster too. Using GPU now actually offers significant speedup over CPU-only inference.
- Python 3.14 support has been enabled.
Breaking changes
- The long-deprecated
addandbothvalues for--resizeinketos trainandketos segtrainhave been removed. Useunionandnewinstead.
Changes
- The legacy polygon extractor has been removed.
--legacy-polygons(ketos train),--no-legacy-polygons(kraken ocr/ketos test) and the matchinglegacy_polygons/no_legacy_polygonsconfig options are still accepted but do nothing. They will be removed in kraken 8. After running some more tests we saw that the change in predictions of recognition models between the extractor implementations is in-line with the inherent non-determinism of modern machine learning libraries. segtrainnow matches dataset classes to the model's classes by name before adapting the model. Fine-tuning with a different class mapping inunion/newmode no longer changes the labels the model already has (#806).- New top-level
wandb_projectsetting (ketos --wandb-projector YAML) for train, segtrain, rotrain and pretrain. - The tensorboard logger now also works with
tensorboardX(#807).
Bug fixes
- Polygonization near image borders is more robust: ROIs are built correctly at the edges (#825), ray intersection is fixed, coordinates are clamped, and baselines no longer need to be as smooth to compute the offset.
- Fixed batches being dropped by the parallel recognizer when the last line of a batch gave an empty record.
- Forced alignment now matches the recognition output.
- Fixed the neural reading order with combined models.
ketos segtestnow picks the right output channels and counts objects of merged classes correctly (#812).- Fixed a crash in legacy
blla.segment()with model files that have no hyperparameters. - Segmentation no longer writes the full model repr to the log for every page.
Misc
- Upgraded lightning to 2.6.6. Updated the CI actions and added Dependabot.
Thanks to Thibault Clérice, Stefan Weil and kobiljon for their contributions.