hebrew-ocr-android / README.md
cyttic's picture
README: large model
dee8783 verified
|
Raw History Blame Contribute Delete
1.3 kB
---
language: he
tags: [ocr, handwriting, hebrew, onnx, android]
---
# Hebrew handwriting OCR: on-device model files
Files downloaded by the Android app (github.com/cyttic/android-hwrg), which runs the whole pipeline on the phone.
| File | What |
|---|---|
| `line_int8.onnx` | CTC line model `cyttic/exp35-trocr-base-en-ctc-seqhead-allreal-synpunct` (TrOCR-base ViT encoder + 2-layer transformer CTC head, 198 classes), ONNX opset 17, dynamic int8 (all constant-weight MatMuls except the ViT layer-2 MLP fc2, kept in fp32). Inputs: `pixel_values` (B, 3, 384, 384) in [-1, 1], `cols` (B,) int64; output `log_probs` (B, 288, 198). |
| `line_large_int8.onnx` | CTC line model `cyttic/exp35-trocr-large-en-ctc-seqhead-allreal-synpunct` (TrOCR-large ViT encoder, 24 layers + 2-layer transformer CTC head), same inputs/outputs; dynamic int8 except the ViT layer-0 MLP fc2 (fp32). Decoded with the punctuation-aware LM fusion (alpha 0.3, beta 0.6, LM on Hebrew letters + space). |
| `charset.json` | `chars[k]` = character of class k; `chars[0]` = CTC blank. |
| `heb_char6_kn.bin.gz` | Character 6-gram LM, interpolated Kneser-Ney (Ben-Yehuda + DictaGen text), binary layout in `tools/export_lm.py`. |
The line finder is `PaddlePaddle/PP-OCRv5_server_det_onnx` (Apache-2.0), downloaded from its own repo.