mangaOCR after continued pre-training on new data: technical report, two models (CPT / CPT-flex) and inference code
Python
0
2 commits
updated Oct 15, 2026
This is an experimental repository. We kept the architecture of mangaOCR (kha-white/manga-ocr-base) unchanged, replaced only its vocabulary, and continued pre-training it (CPT) on new training data.
The main content of this repository is the experimental findings; see the technical report for the full account. The repository also provides two models and their inference code.
| Model | Input | Weights |
|---|---|---|
| manga-ocr-base-CPT-flex (recommended) | Aspect ratio kept, at most 196 patches | Hugging Face · ModelScope |
| manga-ocr-base-CPT | Stretched to 224 × 224, exactly as the original mangaOCR | Hugging Face · ModelScope |
The two models share the same architecture, parameter count (111M) and training settings; only the input differs. Below they are called CPT-flex and CPT-224.
no_repeat_ngram_size=3. On the 301 boxes whose label contains a repeated 3-character fragment, EM is 21.59% with the default settings and 68.77% with greedy decoding.accel/.See the technical report for the data, tests and limitations behind each finding.
All 7,789 boxes of JMangaBench_Read v1.3, RIN v1 normalisation, batch 1, RTX 2080 Ti. See the benchmark's documentation for the model settings and scoring.
| Model | Params | Score ↑ | CER % ↓ | EM % ↑ | EM printed | EM non-printed |
|---|---|---|---|---|---|---|
| CPT-flex | 111M | 97.45 | 1.53 | 91.42 | 94.16 | 83.00 |
| CPT-224 | 111M | 97.43 | 1.77 | 91.00 | 93.82 | 82.32 |
| mangaOCR (original, package defaults) | 111M | 90.23 | 4.84 | 78.25 | 88.04 | 48.17 |
| mangaOCR (original, greedy) | 111M | 89.82 | 6.16 | 81.29 | 91.87 | 48.80 |
| manga-ocr-nar-small (our non-autoregressive model) | 54M | 97.26 | 1.73 | 91.09 | 94.44 | 80.81 |
| Hayai v2.5 Nova p384 | 157M | 96.62 | 2.40 | 88.00 | 91.70 | 76.62 |
| PaddleOCR-VL-For-Manga | 959M | 94.98 | 2.03 | 87.52 | 94.78 | 65.22 |
no_repeat_ngram_size=3) and greedy decoding. Both run in fp16 on the GPU.RTX 2080 Ti, Read v1.3 speed protocol, preprocessing included. For page latency a page is one batch; a page has 8.7 boxes on average.
| Inference path | Per crop (batch 1) | Page p50 | Peak throughput |
|---|---|---|---|
| CPT-flex, CUDA path | 11.0 ms | 43.0 ms | 260 crops/s (batch 32) |
| CPT-flex, plain path | 27.6 ms | 71.4 ms | 242 crops/s (batch 80) |
| CPT-224, CUDA path | 10.4 ms | 38.1 ms | 277 crops/s (batch 32) |
| CPT-224, plain path | 27.6 ms | 69.7 ms | 234 crops/s (batch 64) |
| mangaOCR (original manga-ocr package, fp16) | 84.9 ms | 242.4 ms | 42 crops/s (batch 56) |
transformers generation loop (technical report §4.2).pip install git+https://github.com/muscgab/manga-ocr-CPT
from manga_ocr_cpt import MangaOcrCPT
ocr = MangaOcrCPT("flex") # or "224"; downloads the weights from Hugging Face on first use (about 444 MB)
ocr("crop.png") # one crop -> str
ocr(["crop1.png", "crop2.png"]) # the crops of one page -> list[str], run as one batch
device="cpu" or "mps", and force the plain path with backend="plain".decoder="fp16" runs the decoder's matrix products in fp16 (CUDA only), about 1 ms faster per crop. For CPT-flex it changes 2 outputs on Read v1.3 without changing the scores. The default "fp32" reproduces the evaluated outputs exactly.modelscope download --model muscgab/manga-ocr-base-CPT-flex --local_dir manga-ocr-base-CPT-flex
ocr = MangaOcrCPT("manga-ocr-base-CPT-flex") # local directory
Command line:
manga-ocr-cpt crop1.png crop2.png # one "path<TAB>text" line per crop; --model 224 switches model
transformers.| File | Contents |
|---|---|
manga_ocr_cpt/ | Inference code: network, CPU / GPU preprocessing, CUDA-graph runner, command line |
accel/ | Accelerated inference for Hayai v2.5 Nova and PaddleOCR-VL-For-Manga (with their original weights), and a script that compares them box by box with the originals |
TECHNICAL_REPORT.md / TECHNICAL_REPORT_zh.md | Technical report (English / Chinese) |
samples/ | 8 example crops from JMangaBench_Read v1.3 |
NOTICE.md | Provenance and acknowledgements |
LICENSE | Apache License 2.0 (code) |
This repository contains no weights. The weights are in the two model repositories on Hugging Face and ModelScope.
NOTICE.md for provenance and acknowledgements.mangaOCR after continued pre-training on new data: technical report, two models (CPT / CPT-flex) and inference code
Python
0
2 commits
updated Oct 15, 2026
This is an experimental repository. We kept the architecture of mangaOCR (kha-white/manga-ocr-base) unchanged, replaced only its vocabulary, and continued pre-training it (CPT) on new training data.
The main content of this repository is the experimental findings; see the technical report for the full account. The repository also provides two models and their inference code.
| Model | Input | Weights |
|---|---|---|
| manga-ocr-base-CPT-flex (recommended) | Aspect ratio kept, at most 196 patches | Hugging Face · ModelScope |
| manga-ocr-base-CPT | Stretched to 224 × 224, exactly as the original mangaOCR | Hugging Face · ModelScope |
The two models share the same architecture, parameter count (111M) and training settings; only the input differs. Below they are called CPT-flex and CPT-224.
no_repeat_ngram_size=3. On the 301 boxes whose label contains a repeated 3-character fragment, EM is 21.59% with the default settings and 68.77% with greedy decoding.accel/.See the technical report for the data, tests and limitations behind each finding.
All 7,789 boxes of JMangaBench_Read v1.3, RIN v1 normalisation, batch 1, RTX 2080 Ti. See the benchmark's documentation for the model settings and scoring.
| Model | Params | Score ↑ | CER % ↓ | EM % ↑ | EM printed | EM non-printed |
|---|---|---|---|---|---|---|
| CPT-flex | 111M | 97.45 | 1.53 | 91.42 | 94.16 | 83.00 |
| CPT-224 | 111M | 97.43 | 1.77 | 91.00 | 93.82 | 82.32 |
| mangaOCR (original, package defaults) | 111M | 90.23 | 4.84 | 78.25 | 88.04 | 48.17 |
| mangaOCR (original, greedy) | 111M | 89.82 | 6.16 | 81.29 | 91.87 | 48.80 |
| manga-ocr-nar-small (our non-autoregressive model) | 54M | 97.26 | 1.73 | 91.09 | 94.44 | 80.81 |
| Hayai v2.5 Nova p384 | 157M | 96.62 | 2.40 | 88.00 | 91.70 | 76.62 |
| PaddleOCR-VL-For-Manga | 959M | 94.98 | 2.03 | 87.52 | 94.78 | 65.22 |
no_repeat_ngram_size=3) and greedy decoding. Both run in fp16 on the GPU.RTX 2080 Ti, Read v1.3 speed protocol, preprocessing included. For page latency a page is one batch; a page has 8.7 boxes on average.
| Inference path | Per crop (batch 1) | Page p50 | Peak throughput |
|---|---|---|---|
| CPT-flex, CUDA path | 11.0 ms | 43.0 ms | 260 crops/s (batch 32) |
| CPT-flex, plain path | 27.6 ms | 71.4 ms | 242 crops/s (batch 80) |
| CPT-224, CUDA path | 10.4 ms | 38.1 ms | 277 crops/s (batch 32) |
| CPT-224, plain path | 27.6 ms | 69.7 ms | 234 crops/s (batch 64) |
| mangaOCR (original manga-ocr package, fp16) | 84.9 ms | 242.4 ms | 42 crops/s (batch 56) |
transformers generation loop (technical report §4.2).pip install git+https://github.com/muscgab/manga-ocr-CPT
from manga_ocr_cpt import MangaOcrCPT
ocr = MangaOcrCPT("flex") # or "224"; downloads the weights from Hugging Face on first use (about 444 MB)
ocr("crop.png") # one crop -> str
ocr(["crop1.png", "crop2.png"]) # the crops of one page -> list[str], run as one batch
device="cpu" or "mps", and force the plain path with backend="plain".decoder="fp16" runs the decoder's matrix products in fp16 (CUDA only), about 1 ms faster per crop. For CPT-flex it changes 2 outputs on Read v1.3 without changing the scores. The default "fp32" reproduces the evaluated outputs exactly.modelscope download --model muscgab/manga-ocr-base-CPT-flex --local_dir manga-ocr-base-CPT-flex
ocr = MangaOcrCPT("manga-ocr-base-CPT-flex") # local directory
Command line:
manga-ocr-cpt crop1.png crop2.png # one "path<TAB>text" line per crop; --model 224 switches model
transformers.| File | Contents |
|---|---|
manga_ocr_cpt/ | Inference code: network, CPU / GPU preprocessing, CUDA-graph runner, command line |
accel/ | Accelerated inference for Hayai v2.5 Nova and PaddleOCR-VL-For-Manga (with their original weights), and a script that compares them box by box with the originals |
TECHNICAL_REPORT.md / TECHNICAL_REPORT_zh.md | Technical report (English / Chinese) |
samples/ | 8 example crops from JMangaBench_Read v1.3 |
NOTICE.md | Provenance and acknowledgements |
LICENSE | Apache License 2.0 (code) |
This repository contains no weights. The weights are in the two model repositories on Hugging Face and ModelScope.
NOTICE.md for provenance and acknowledgements.