NDLOCR-Lite PARSeq (100-character model), safetensors
The text line recogniser of NDLOCR-Lite by the National Diet Library (国 ONNX to safetensors so itcan be loaded without an ONNX runtime. It reads one line of Japanese text, horizontal or vertical, up to 100 characters.
Attribution
- Original work:
parseq-ndl-24x768-100-tinyfrom ndl-lab/ndlocr-lite, © National Diet Library. - Licence: [CC BY 4.0/licenses/by/4.0/), thesame as the original. Using these files means giving the same credit.
Changes from the original
- The ONNX initialisers (
model.encoder.*, a ViT, andmodel.decoder.*, a PARSeq decoder; 9.8M parameters) are stored as safetensors, unchanged in name and shape. - Weights are stored in float16 (upcast to float32 at load).
- The character set is taken from
NDLmoji.yaml(charset_train) intondl_charset.txt, one character per line, in the original order.
No weights were retrained or fine-tuned.
Files
| File | Size | SHA-256 |
|---|---|---|
ndl.safetensors | 17,8edf587801e62d34e4df2229932abd72f0a8e99cccc6e7e3e5fc4aafbd69aae0 | |
ndl_charset.txt | 28,323 bytes | a7485e9be913dcaa2dd560e8ab58193bce58bb6062db9dd130bf5014da430e53 |
Using it
- Input:
1 x 3 x 24 x 768, RGB, scaled to[-1, 1](x / 127.5 - 1). A vertical line (height > 0.8 × wilockwise first, then thecrop is resized to 24 × 768. - Output: up to 101 decode steps. Token 0 ends the line; token
k(1 to 7,141) is linekofndl_charset.txt, counting from 1. The first entry is a space. - Accuracy: outputs match the original ONNX model under onnxruntime on 60 test lines, in both float32 and the stored float16. vertical, up to 100 characters.
Attribution
- Original work:
parseq-ndl-24x768-100-tinyfrom ndl-lab/ndlocr-lite, © National DLibrary. - Licence: CC BY 4.0, the same as the original. Using these files means giving the same credit.
Changes from the original
- The ONNX initialisers (
model.encoder.*, a ViT, andmodel.decoder.*, a PARSeq decoder; 9.8M parameters) are stored as safetensors, unchanged in name and shape. - Weights are stored in float16 (upcast to float32 at load).
- The character set is taken from
NDLmoji.yaml(charset_train) intondl_charset.txt, one character per line, in the original order.
No weights were retrained or fine-tuned.
Files
| File | Size | SHA-256 |
|---|---|---|
ndl.safetensors | 17,681,116 bytes | 8edf587801e62d34e4df2229aafbd69aae0 |
ndl_charset.txt | 28,323 bytes | a7485e9be913dcaa2dd560e8ab58193bce58bb6062db9dd130bf5014da430e53 |
## Using it
- Input:
1 x 3 x 24 x 768, RGB, scaled to[-1, 1](x / 127.5 - 1). A vertical line (height > 0.8 × wilockwise first, then thecrop is resized to 24 × 768. - Output: up to 101 decode steps. Token 0 ends the line; token
k(1 to 7,141) is linekofndl_charset.txt, counting from 1. The first entry is a space. - Accuracy: outputs match the original ONNX model under onnxruntime on 60 test lines, in both float32