PP-OCRv6 Samaritan Hebrew recognizers
Line-level text recognition models for Samaritan Hebrew manuscripts,
trained with kraken’s PP-OCRv6 port (ketos train --arch ppocrv6) and usable
with oxygraphos-ocr / Ppocrv6-OCR
(ppocrv6-ocr) or stock kraken ≥ 7.0.
These are recognizers only (line crops / baseline polygons). Pair with a page segmenter for full-page OCR.
Files
| File | Variant | Val char accuracy* | Codec | Size (approx.) | Notes |
|---|---|---|---|---|---|
ppocrv6_sam_heb_small.safetensors |
small |
0.9872 | 28 Hebrew letters + space | ~12 MB | From scratch |
ppocrv6_sam_heb_medium.safetensors |
medium |
0.9877 | 28 Hebrew letters + space | ~60 MB | From scratch |
ppocrv6_sam_heb_medium_ft.safetensors |
medium |
0.9886 | ~1622 chars (multilingual head retained) | ~61 MB | Fine-tuned from a multilingual PP-OCRv6 checkpoint |
*Accuracy is the kraken checkpoint score embedded in the original best_*.safetensors filename (validation character accuracy).
Default recommendation: ppocrv6_sam_heb_medium_ft.safetensors for best accuracy on this domain. Use small when latency / footprint matters. Prefer the Hebrew-only small / medium codecs if you want a locked Samaritan alphabet (no Latin / punctuation emissions).
Model details
| Architecture | PPOCRv6Model (kraken), task recognition |
| Input | RGB line images, target height 96, baseline / polygon-dewarped lines (seg_type: baselines) |
| Normalization | NFD + whitespace normalize; BiDi reordering enabled at train time |
| Data | Samaritan Hebrew PAGE-XML line corpus (sam_44_mss_pango / additional split), compiled to binary Arrow |
| Min kraken | 7.0.0 (_kraken_min_version in metadata) |
Codec is stored inside each .safetensors file under kraken_meta — no sidecar alphabet file is required.
Usage
Download
hf download johnlockejrr/ppocrv6-sam-heb ppocrv6_sam_heb_medium_ft.safetensors --local-dir ./models
oxygraphos-ocr / ppocrv6-ocr
ppocrv6-ocr -d cuda:0 infer \
-m ./models/ppocrv6_sam_heb_medium_ft.safetensors \
-f page --output-dir ./out page.xml
kraken
kraken -i line.png text.txt ocr -m ./models/ppocrv6_sam_heb_medium_ft.safetensors
Intended use
- Samaritan Hebrew manuscript line recognition (square Hebrew Unicode)
- Offline HTR pipelines that already produce line polygons / crops
Limitations
- Not a page layout / line detector
- Trained on this manuscript family; other hands / scripts may need fine-tuning
medium_ftretains a large multilingual output vocabulary; greedy decoding can occasionally emit non-Hebrew symbols on ambiguous lines- Hebrew-only
small/mediumcannot emit characters outside their 28-letter (+ space) codec
Training summary
- Trainer: kraken
ketos/ PP-OCRv6 (AdamW+Muon, cosine schedule, bf16-mixed) - Augmentation on;
--base-dir R/ RTL-aware setup for Hebrew medium/small: trained from scratch on the Samaritan binary datasetmedium_ft: fine-tuned from a multilingual medium checkpoint onto the same data (lower LR); final weights keep the large pretrained codec
Citation / credits
- PP-OCR / PP-OCRv6: PaddlePaddle/PaddleOCR
- kraken PP-OCRv6 port: mittagessen/kraken
- Packaging: johnlockejrr/oxygraphos-ocr (
Ppocrv6-OCR)
License
Apache-2.0 (weights and card). Upstream PaddleOCR / kraken licenses still apply to those codebases.