Downloads · 30 days
155
100% of all-time downloads
Kellenok/PP-OCRv6_manga
PP-OCRv6_manga is a image-to-text model from Kellenok. Use it when you need a caption or text from an image. It is set up for onnx. The card lists the license as apache-2.0.
PP-OCRv6manga is a lightweight pipeline for manga and anime text detection and recognition (Japanese and Chinese), small enough to run on a CPU: detection 0.9 MB + recognition 10 MB in FP16.
Downloads · 30 days
155
100% of all-time downloads
All-time downloads
155
Public
Repo size
116 MB
Likes
7
Trending 2
Click a slice to open those files.
.onnx69.2 MB · 60%
From the Hugging Face model README
PP-OCRv6_manga is a lightweight pipeline for manga and anime text detection and recognition (Japanese and Chinese), small enough to run on a CPU: detection 0.9 MB + recognition 10 MB in FP16.
<p align="center"> <img src="assets/rec_by_benchmark.webp" alt="Text recognition: CER on Manga, Illustrations and JMangaBench_Read"> </p> <p align="center"> <img src="assets/rec_japanese_vs_size.webp" alt="Japanese recognition: CER vs model size"> </p>New detector manga_det_v0.2 and recognizer manga_rec_v0.2, drop-in replacements for v0.1 with the same architectures, sizes and speed.
Detector. Retrained on much more manga, webtoon and illustration data. It misses fewer lines, splits or merges lines less often and gives a third fewer false positives on illustrations. With the same recognizer, end-to-end CER drops by about 11% (Table 1).
Recognizer. v0.1 had forgotten most rare kanji; v0.2 brings CER on rare characters from about 60% to about 10% and on SFX from about 45% to about 26%. The other benchmarks improve by about 20% relative CER (Table 2).
Full pipeline, end-to-end CER on the Table 1 pages:
| v0.1 | v0.2 | Change | |
|---|---|---|---|
| Manga | 12.61% | 10.03% | −20.5% |
| Webtoons | 8.38% | 6.21% | −25.9% |
| Illustrations | 18.55% | 16.36% | −11.8% |
| Total | 13.81% | 11.34% | −17.9% |
| Component | Architecture | Paddle | ONNX FP32 | ONNX FP16 |
|---|---|---|---|---|
Det manga_det_v0.2 (default) | PP-OCRv6 tiny (PPLCNetV4 + RepLKFPN + DBHead) | 1.9 MB | 1.73 MB | 0.92 MB |
Det manga_det_v0.1 | same | 2.05 MB | 1.73 MB | 0.92 MB |
Rec manga_rec_v0.2 (default) | PP-OCRv6 small (PPLCNetV4 + lightSVTR + MultiHead CTC/NRTR) | ~21.3 MB | 21.17 MB | 10.63 MB |
Rec manga_rec_v0.1 | same | ~21.3 MB | 21.17 MB | 10.63 MB |
ppocrv6_dict.txt (18,708 symbols), shared by both recognizers..pdparams files contain the inference weights (backbone + CTC branch).・・・ = …, ♥ / ❤ = ♡, 〇 / ◯ = ○, 〝〟 dropped).sfx in the GT (manga 292, illustrations 97; webtoon strips not mapped), read on their GT boxes like the rest of Table 2.| v0.2<br>960 | v0.2<br>1120 | v0.1<br>960 | v0.1<br>1120 | base small<br>960 | base medium<br>960 | |
|---|---|---|---|---|---|---|
| Size, MB | 1.9 | 1.9 | 2.05 | 2.05 | 10.3 | 64.3 |
| Manga | ||||||
| Recall, % | <u>94.65</u> | 94.81 | 94.04 | 94.43 | 90.69 | 92.50 |
| FP | 490 | 467 | <u>460</u> | <u>460</u> | 466 | 413 |
| CER, % | <u>10.06</u> | 9.85 | 11.38 | 11.50 | 13.98 | 11.10 |
| Webtoons | ||||||
| Recall, % | 96.13 | 96.70 | <u>96.28</u> | 96.13 | 93.27 | 94.56 |
| FP | 96 | 93 | 108 | 140 | <u>75</u> | 49 |
| CER, % | 6.21 | <u>6.02</u> | 6.84 | 6.69 | 5.97 | 6.79 |
| Illustrations | ||||||
| Recall, % | 90.02 | 90.68 | 88.94 | <u>90.26</u> | 87.33 | 89.84 |
| FP | <u>297</u> | 283 | 446 | 344 | 330 | 346 |
| CER, % | 16.30 | 15.03 | 17.80 | 16.27 | 18.87 | <u>15.79</u> |
| Total CER, % | <u>11.35</u> | 10.89 | 12.68 | 12.41 | 14.79 | 12.01 |
v0.2 / v0.1: manga_det_v0.2 / manga_det_v0.1; base small / medium: the official PP-OCRv6 detectors. 960 / 1120: detector input long side (the demo app uses 960). FP: unmatched boxes; ruby boxes next to a GT line are not FP (geometric rule on the GT side, independent of the app filter). CER: end-to-end CER. Best in bold, second best underlined.
All detectors run the demo pipeline: thresh=0.15, box_thresh=0.25, unclip_ratio=1.4, area resize for long strips, learned furigana filter, block-aware reading order, then manga_rec_v0.2.
| v0.2 | v0.1 | hayai v2.5 nova<br>(p512) | manga-ocr<br>nar small | base medium | base small | |
|---|---|---|---|---|---|---|
| Size (FP32), MB | 21 | 21 | 599 | 217 | 73 | 21 |
| Manga | 3.38 | 4.46 | <u>3.83</u> | 3.44* | 7.59 | 8.41 |
| Manhua / webtoon | 2.03 | 2.49 | 8.79 | — | <u>2.24</u> | 2.85 |
| Illustrations | 7.26 | <u>9.46</u> | 10.63 | 10.53* | 13.98 | 14.48 |
| SFX, Manga109 (weighted) | 26.00 | 45.49 | 16.48 | <u>22.21</u> | 73.86 | 81.28 |
| SFX, Table 2 pages | 28.62 | 38.54 | 26.60 | <u>26.87</u> | 70.24 | 73.84 |
| Rare kanji, synthetic (weighted) | 10.62 | 59.72 | 80.94¹ | 81.09¹ | <u>21.89</u> | 26.49 |
| Rare kanji, real lines | 6.22 | 8.17 | <u>6.73</u> | 8.62 | 9.13 | 10.27 |
| JMangaBench_Read, composite ↑ | 95.66 | 93.92 | <u>96.58</u> | 97.29 | 86.05 | 83.81 |
| JMangaBench_Read, CER | <u>2.04</u> | 2.87 | 2.35 | 1.71 | 7.44 | 8.51 |
| Japanese | 4.23 | 5.60 | 4.56 | <u>4.32</u> | 9.61 | 10.84 |
| Chinese | 2.74 | <u>3.44</u> | 9.00 | — | 3.51 | 4.71 |
| Total | 4.08 | <u>5.34</u> | 5.50 | 4.32* | 8.54 | 9.28 |
| Exact match, % ↑ | 84.37 | 80.35 | <u>82.49</u> | 86.34* | 73.54 | 71.11 |
v0.2 / v0.1: manga_rec_v0.2 / manga_rec_v0.1; hayai: hayai-ocr-v2.5-nova; manga-ocr nar small: manga-ocr-nar-small (muscgab, CC BY-NC-SA 4.0); base: the official PP-OCRv6 recognizers. Best in bold, second best underlined (plain numbers only, not *, ¹).
* Japanese only: manga-ocr nar small does not read Chinese or Latin, so these values are on the Japanese lines (v0.2 on the same lines: 4.23 total / 84.67 exact).
¹ Random character strings without context; see the real-lines row.
JMangaBench_Read: hayai and manga-ocr nar small read the whole crop (official leaderboard numbers, reproduced locally); PaddleOCR models run the demo pipeline on each crop. manga-ocr nar small trained on AnimeText-OCR crops, which may overlap Table 2.
| Task | Model | FP32 | FP16 |
|---|---|---|---|
| Detection (Table 1 total end-to-end CER) | manga_det_v0.2 | 11.37% | 11.39% |
| Recognition (Table 2 total CER) | manga_rec_v0.2 | 5.72% | 5.79% |
| Recognition (Table 2 total CER) | manga_rec_v0.1 | 6.80% | 6.87% |
FP16 halves the size at a cost of ~0.05 pp CER. ONNX FP32 matches Paddle (detection: 11.34% in Paddle; recognition: 1496/1500 identical predictions).
PP-OCRv6_manga/
├── README.md
├── ppocrv6_dict.txt # Character dictionary (18,708 symbols)
├── examples/
│ ├── onnx_openvino.py # ONNX / OpenVINO pipeline
│ └── paddle_inference.py # Paddle models + PaddleOCR post-processing
├── det/
│ ├── manga_det_v0.2.pdparams # Paddle weights (1.9 MB) <- default
│ ├── manga_det_v0.2.onnx # ONNX FP32 (1.73 MB)
│ ├── manga_det_v0.2_fp16.onnx # ONNX FP16 (0.92 MB)
│ ├── manga_det_v0.1.pdparams # previous version
│ ├── manga_det_v0.1.onnx
│ └── manga_det_v0.1_fp16.onnx
└── rec/
├── manga_rec_v0.2.pdparams # Paddle inference weights (21.3 MB) <- default
├── manga_rec_v0.2.onnx # ONNX FP32 (21.2 MB)
├── manga_rec_v0.2_fp16.onnx # ONNX FP16 (10.6 MB)
├── manga_rec_v0.1.pdparams # previous version
├── manga_rec_v0.1.onnx
└── manga_rec_v0.1_fp16.onnx
examples/onnx_openvino.py, the full pipeline (detection, DB post-processing, recognition) for one page.
pip install openvino opencv-python numpy pyclipper huggingface_hub
python examples/onnx_openvino.py page.jpg
examples/paddle_inference.py, model definitions and weights with PaddleOCR's DBPostProcess and CTCLabelDecode.thresh=0.15, box_thresh=0.25, unclip_ratio=1.4, detector input long side 960 (pages longer than 2:1 get the pixel budget of a 3:4 page instead).