A reproducible mixed-domain benchmark for Japanese manga OCR.
JMangaBench_Mixed is a relatively easy, reproducible mixed-domain benchmark for Japanese manga OCR that simulates real-world conditions. It evaluates both real manga text and controlled synthetic text. It contains 3,286 samples and reports not only one overall score, but also results by data source, text-length group, crop type, scene type, and writing orientation.
The repository contains the code, recipes, released rendering layers, hashes, and evaluator required to reproduce the benchmark. Manga109-s pixels are not redistributed: users obtain Manga109-s separately and build the image set locally.
| Component | Count | Description |
|---|---|---|
| Total | 3,286 | One image and one reference string per sample |
| Real crops | 1,286 | Locally reconstructed from Manga109-s |
| Synthetic samples | 2,000 | Four groups of 500 |
| Synthetic body-text masks | 2,000 | Furigana is excluded from the body-text mask |
| Orientation | 1,390 vertical / 610 horizontal | Synthetic samples only |
| Crop type | 1,000 text crops / 1,000 balloon crops | Synthetic samples only |
| Scene type | 1,600 balloon / 400 direct text | Synthetic samples only |
crop_type | Crop rule | Balloon scene | Direct-text scene | Total |
|---|---|---|---|---|
text_detector_crop | Body-text mask bounding box plus realized padding | 600 | 400 | 1,000 |
balloon_detector | Full generated canvas; no second crop around the text | 1,000 | 0 | 1,000 |
Both crop types are scored with OCR metrics. No detector metric is computed.
The synthetic groups are:
| Subset | Samples | Configured visible-text range |
|---|---|---|
mixed_4_8 | 500 | 4–8 |
mixed_9_13 | 500 | 9–13 |
mixed_14_18 | 500 | 14–18 |
mixed_19_40 | 500 | 19–40 |
Every group is balanced between 250 text_detector_crop and 250 balloon_detector samples.
The synthetic set uses 28 distinct font files and 82 distinct container assets:
The repository retains 48 GPL SVG sources; 44 of them are used by the final samples. A pool of 1,000 Manga109-s background regions is used twice across the 2,000 synthetic samples.
| Field | Frozen value |
|---|---|
| Source dataset | Manga109-s |
| Source release | Manga109-v2026 |
| Reference package date | 2026-05-21 |
| Annotation source used to prepare the recipes | Current annotations/ included with Manga109-v2026 |
| Manga109-s files read during local reconstruction | images/ only |
| Real-crop source verification | Full-page file SHA-256, page dimensions, and decoded crop pixel SHA-256 are strict checks |
| Synthetic source verification | Page dimensions, source-region pixel SHA-256, foreground SHA-256, and label-layer SHA-256 are strict checks |
| Generated-image verification | Final PNG SHA-256 differences are warnings recorded in sha256_warnings.jsonl |
The version label is recorded as source metadata. A mismatch in a source asset or decoded source crop stops construction. A final generated-image SHA-256 difference does not stop construction and is recorded in the warning report.
The generated-image reference hashes were produced on the following Linux/amd64 system:
| Field | Reference value |
|---|---|
| JMangaBench_Mixed | v1.0.0 |
| OS | Ubuntu 22.04.1 LTS |
| Kernel | 5.15.0-133-generic |
| Architecture | x86_64 |
| CPU | Intel Xeon Platinum 8358P |
| GPU | NVIDIA GeForce RTX 4090, 24 GB; used for OCR inference only, not PNG construction |
| Python | 3.13.14 (Anaconda, GCC 14.3) |
| Pillow | 12.3.0 |
| JPEG codec ABI | 6.2 |
| libjpeg-turbo | 3.1.4.1 |
| zlib | 1.3.2 |
The repository also provides a pinned Linux/amd64 Docker build. Its base image
is ghcr.io/astral-sh/uv@sha256:531f855bda2c73cd6ef67d56b733b357cea384185b3022bd09f05e002cd144ca.
The resulting runtime uses Python 3.13.11, Pillow 12.3.0, JPEG codec ABI 6.2,
libjpeg-turbo 3.1.4.1, and zlib 1.2.13.
Native builds on macOS or Windows can produce a different final PNG byte stream or slightly different generated pixels because image codecs and numerical implementations differ across platforms. Such differences may be visually and OCR-negligible, but SHA-256 alone does not measure their practical effect. The builder therefore reports every affected generated image without treating it as a source-data failure.
The following results were exported on 2026-07-28. All inference was performed on the same Linux server with one NVIDIA GeForce RTX 4090 24 GB GPU. Each model processed one image at a time in canonical benchmark order. Per-image latency does not include model loading and is hardware-dependent.
Two locally constructed image sets were evaluated:
Linux reference: the Linux/amd64 reference construction described above;macOS private: the earlier private construction produced on macOS.Both sets contain the same 3,286 sample IDs and reference strings. The accuracy metrics were identical for each model, so they are reported once:
| Model | CER ↓ | Exact match ↑ | Text-only CER ↓ | Text-only exact match ↑ |
|---|---|---|---|---|
| MangaOCR | 4.683% | 73.524% | 2.700% | 82.867% |
| HayaiOCR | 6.738% | 71.272% | 4.967% | 80.949% |
| BaberuOCR | 4.589% | 72.246% | 2.603% | 81.649% |
| PaddleOCR-VL-0.9B-For-Manga | 2.910% | 78.911% | 1.866% | 84.662% |
Sequential per-image latency on the RTX 4090:
| Model | Linux-reference input mean | Linux-reference p50 | Linux-reference p95 | macOS-private input mean | macOS-private p50 | macOS-private p95 |
|---|---|---|---|---|---|---|
| MangaOCR | 83.0 ms | 74.8 ms | 151.5 ms | 84.6 ms | 77.0 ms | 153.0 ms |
| HayaiOCR | 102.6 ms | 96.3 ms | 175.3 ms | 101.5 ms | 95.3 ms | 172.0 ms |
| BaberuOCR | 103.1 ms | 92.1 ms | 203.7 ms | 104.2 ms | 92.6 ms | 205.8 ms |
| PaddleOCR-VL-0.9B-For-Manga | 242.0 ms | 211.8 ms | 490.6 ms | 246.7 ms | 219.2 ms | 487.7 ms |
Cross-construction prediction comparison:
| Model | Samples | Raw prediction differences | Normalized prediction differences | Metric differences |
|---|---|---|---|---|
| MangaOCR | 3,286 | 0 | 0 | 0 |
| HayaiOCR | 3,286 | 0 | 0 | 0 |
| BaberuOCR | 3,286 | 0 | 0 | 0 |
| PaddleOCR-VL-0.9B-For-Manga | 3,286 | 1 | 0 | 0 |
The single raw PaddleOCR difference for jmm_19_40_000180 consisted only of
inserted line breaks; whitespace normalization made the predictions identical.
Across 13,144 model-sample comparisons, there were no normalized prediction
differences and no metric differences. For these two constructions and four
tested models, the cross-platform image differences had no measurable effect
on the reported OCR accuracy.
Docker is the shortest reference-platform path. Docker Desktop users on macOS
or Windows should keep --platform linux/amd64 in both commands:
docker build --platform linux/amd64 -t jmangabench-mixed:1.0.0 .
mkdir -p /absolute/path/to/output-parent
docker run --rm --platform linux/amd64 \
-v "/absolute/path/to/Manga109s_released_2026_05_21:/data/Manga109s:ro" \
-v "/absolute/path/to/output-parent:/output" \
jmangabench-mixed:1.0.0 \
build \
--manga109s-root /data/Manga109s \
--output /output/JMangaBench_Mixed \
--workers 10
For a native installation, requirements are:
From the repository root:
uv sync --frozen
uv run python tools/verify_release.py --release-root .
uv run python -m jmangabench build \
--manga109s-root /path/to/Manga109s_released \
--output ./JMangaBench_Mixed \
--workers 10
The one-command builder verifies the repository, reconstructs the real and synthetic components, performs strict source checks, and assembles the final benchmark in canonical order. The output directory must not already exist.
Expected output:
JMangaBench_Mixed/
annotations.jsonl
manifest.json
sha256_warnings.jsonl
images/
real_crops/
synthetic/
masks/
body_text/
sha256_warnings.jsonl is empty when every generated image matches the Linux
reference. Otherwise, each line identifies one image, its reference SHA-256,
and its actual SHA-256. Source asset and source-crop failures remain fatal.
JMangaBench_Mixed does not import or manage model frameworks. Copy
examples/predict_jsonl_template.py into the model's own environment and
implement load_model() and predict():
cp examples/predict_jsonl_template.py /path/to/model/run_jmangabench.py
/path/to/model/python /path/to/model/run_jmangabench.py \
--benchmark ./JMangaBench_Mixed \
--output ./predictions.jsonl
The model must produce exactly one JSON object for every benchmark ID:
{"id":"jmm_4_8_000001","prediction":"やあ坊主","latency_seconds":0.123,"error":null}
latency_seconds and error are optional. prediction must always be a string.
uv run python -m jmangabench validate-predictions \
--benchmark ./JMangaBench_Mixed \
--predictions ./predictions.jsonl
uv run python -m jmangabench evaluate \
--benchmark ./JMangaBench_Mixed \
--predictions ./predictions.jsonl \
--output ./evaluation/my_model
Evaluation creates:
evaluation/my_model/
report.json
per_sample.jsonl
The evaluator rejects missing, extra, or duplicate IDs; invalid predictions or latencies; modified annotations; and image or mask hash mismatches.
The frozen protocols are:
jmangabench_mixed_ocr_metrics/v1
jmangabench_mixed_text_normalization/v1
Normalization applies Unicode NFKC and removes whitespace. The text-only policy
removes Unicode punctuation while preserving U+30FC (ー). CER is
micro-averaged; exact match is sample-averaged.
Each report contains overall results and slices by:
source_kind: real or synthetic;subset: real crops or one of the four synthetic length groups;crop_type: real crop, text crop, or balloon crop;scene_type: real crop, balloon, or direct text;orientation: horizontal, vertical, or unspecified.When latency is provided, the report also includes mean, p50, and p95 latency.
release_manifest.json records every distributable file's size and SHA-256.sha256_warnings.jsonl and summarized in manifest.json.annotations.jsonl and checked
by the evaluator before scoring.manifest.json freezes annotations and slice counts.redistribution_allowed: false.Do not upload the locally built benchmark or any private verification image directory.
Project-authored code, documentation, recipes, metadata, and assets are licensed under GPL-3.0-only, unless a file or directory says otherwise.
Third-party terms remain in effect:
notices/manga_editor_desu_gpl3/;notices/fonts/ under SIL Open Font License
1.1;See THIRD_PARTY_NOTICES.md for details.
JMangaBench_Mixed 是一个面向日文漫画 OCR 的模拟真实情况的较简单的可复现混合域评测集。它同时测试真实漫画文字与可控合成文字,共包含 3,286 个样本。
本仓库提供复现 benchmark 所需的代码、配方、发布渲染层、哈希和 evaluator,不重新分发 Manga109-s 像素。用户需要单独取得 Manga109-s,并在本地构建图片测试集。
| 组成 | 数量 | 说明 |
|---|---|---|
| 总计 | 3,286 | 每个样本包含一张图片和一个正文答案 |
| 真实 crop | 1,286 | 在本地从 Manga109-s 恢复 |
| 合成样本 | 2,000 | 四组,每组 500 张 |
| 合成正文 mask | 2,000 | 正文 mask 不包含 furigana |
| 文字方向 | 竖排 1,390 / 横排 610 | 仅统计合成样本 |
| Crop 类型 | 文字 crop 1,000 / 气泡 crop 1,000 | 仅统计合成样本 |
| 场景类型 | 气泡 1,600 / 直接文字 400 | 仅统计合成样本 |
crop_type | 裁剪规则 | 气泡场景 | 直接文字场景 | 合计 |
|---|---|---|---|---|
text_detector_crop | 正文 mask 包围框加实际 padding | 600 | 400 | 1,000 |
balloon_detector | 保留完整生成画布,不围绕正文二次裁剪 | 1,000 | 0 | 1,000 |
两种 crop 均使用 OCR 指标评分,不计算检测器指标。
四个合成分组为:
| 子集 | 样本数 | 配置的可见文字范围 |
|---|---|---|
mixed_4_8 | 500 | 4–8 |
mixed_9_13 | 500 | 9–13 |
mixed_14_18 | 500 | 14–18 |
mixed_19_40 | 500 | 19–40 |
每组均包含 250 张 text_detector_crop 和 250 张 balloon_detector。 |
合成样本实际使用 28 个不同的字体文件和 82 个不同的容器资产:
仓库保留了 48 个 GPL SVG 源文件,其中 44 个实际进入最终样本。合成数据使用 1,000 个 Manga109-s 背景区域,每个背景在 2,000 张样本中使用两次。
| 字段 | 冻结值 |
|---|---|
| 来源数据集 | Manga109-s |
| 来源版本 | Manga109-v2026 |
| 参考数据包日期 | 2026-05-21 |
| 生成配方时使用的 annotation | Manga109-v2026 中当前的 annotations/ |
| 本地重建时读取的 Manga109-s 文件 | 仅 images/ |
| 真实 crop 来源验证 | 完整页面文件 SHA-256、页面尺寸和解码后 crop 像素 SHA-256 均为严格校验 |
| 合成来源验证 | 页面尺寸、源区域像素 SHA-256、foreground SHA-256 和 label layer SHA-256 均为严格校验 |
| 生成图片验证 | 最终 PNG SHA-256 差异仅作 Warning,并写入 sha256_warnings.jsonl |
版本名称作为来源元数据记录。源资产或解码后源 crop 不一致时构建会立即失败;仅最终 生成图片 SHA-256 不一致时不会中止,而是写入 Warning 报告。
最终生成图片的参考哈希来自以下 Linux/amd64 环境:
| 字段 | 参考值 |
|---|---|
| JMangaBench_Mixed | v1.0.0 |
| 操作系统 | Ubuntu 22.04.1 LTS |
| 内核 | 5.15.0-133-generic |
| 架构 | x86_64 |
| CPU | Intel Xeon Platinum 8358P |
| GPU | NVIDIA GeForce RTX 4090,24 GB;仅用于 OCR 推理,不参与 PNG 构建 |
| Python | 3.13.14(Anaconda,GCC 14.3) |
| Pillow | 12.3.0 |
| JPEG codec ABI | 6.2 |
| libjpeg-turbo | 3.1.4.1 |
| zlib | 1.3.2 |
仓库同时提供固定的 Linux/amd64 Docker 构建,基础镜像为
ghcr.io/astral-sh/uv@sha256:531f855bda2c73cd6ef67d56b733b357cea384185b3022bd09f05e002cd144ca。
容器运行时使用 Python 3.13.11、Pillow 12.3.0、JPEG codec ABI 6.2、
libjpeg-turbo 3.1.4.1 和 zlib 1.2.13。
在 macOS 或 Windows 上原生构建时,图片编解码器和数值实现的跨平台差异可能改变最终 PNG 字节流,或造成轻微的生成像素差异。这类差异对肉眼观感和 OCR prediction 的影响 可能很小,但 SHA-256 本身不能衡量实际影响。因此构建器会列出所有受影响的生成图片, 但不会把它们判定为源数据错误。
以下结果导出于 2026-07-28。全部推理均在同一台 Linux 服务器上使用一张 NVIDIA GeForce RTX 4090 24 GB GPU 完成。每个模型按照 benchmark 固定顺序逐张处理图片。 单张延迟不包含模型加载时间,并且与硬件相关。
本次评测使用两套本地构建图片:
Linux reference:使用上文 Linux/amd64 参考环境构建;macOS private:此前在 macOS 上构建的 private 版本。两套图片包含相同的 3,286 个样本 ID 和 reference。每个模型在两套图片上的准确率指标 完全相同,因此只展示一次:
| 模型 | CER ↓ | Exact Match ↑ | 忽略标点 CER ↓ | 忽略标点 EM ↑ |
|---|---|---|---|---|
| MangaOCR | 4.683% | 73.524% | 2.700% | 82.867% |
| HayaiOCR | 6.738% | 71.272% | 4.967% | 80.949% |
| BaberuOCR | 4.589% | 72.246% | 2.603% | 81.649% |
| PaddleOCR-VL-0.9B-For-Manga | 2.910% | 78.911% | 1.866% | 84.662% |
RTX 4090 上的逐张推理延迟:
| 模型 | Linux-reference 输入平均 | Linux-reference p50 | Linux-reference p95 | macOS-private 输入平均 | macOS-private p50 | macOS-private p95 |
|---|---|---|---|---|---|---|
| MangaOCR | 83.0 ms | 74.8 ms | 151.5 ms | 84.6 ms | 77.0 ms | 153.0 ms |
| HayaiOCR | 102.6 ms | 96.3 ms | 175.3 ms | 101.5 ms | 95.3 ms | 172.0 ms |
| BaberuOCR | 103.1 ms | 92.1 ms | 203.7 ms | 104.2 ms | 92.6 ms | 205.8 ms |
| PaddleOCR-VL-0.9B-For-Manga | 242.0 ms | 211.8 ms | 490.6 ms | 246.7 ms | 219.2 ms | 487.7 ms |
跨构建 prediction 对比:
| 模型 | 样本数 | 原始 prediction 差异 | 规范化 prediction 差异 | 指标差异 |
|---|---|---|---|---|
| MangaOCR | 3,286 | 0 | 0 | 0 |
| HayaiOCR | 3,286 | 0 | 0 | 0 |
| BaberuOCR | 3,286 | 0 | 0 | 0 |
| PaddleOCR-VL-0.9B-For-Manga | 3,286 | 1 | 0 | 0 |
PaddleOCR 唯一一条原始差异出现在 jmm_19_40_000180,内容仅为插入换行;删除空白后
两条 prediction 完全相同。四个模型共 13,144 次样本对比中,规范化 prediction 差异
为 0,评测指标差异也为 0。对于本次对比的两套构建和四个模型,跨平台图片差异没有对
报告中的 OCR 准确率产生可测量影响。
Docker 是最短的参考平台构建方式。在 macOS 或 Windows 的 Docker Desktop 上也应在
两条命令中保留 --platform linux/amd64:
docker build --platform linux/amd64 -t jmangabench-mixed:1.0.0 .
mkdir -p /absolute/path/to/output-parent
docker run --rm --platform linux/amd64 \
-v "/absolute/path/to/Manga109s_released_2026_05_21:/data/Manga109s:ro" \
-v "/absolute/path/to/output-parent:/output" \
jmangabench-mixed:1.0.0 \
build \
--manga109s-root /data/Manga109s \
--output /output/JMangaBench_Mixed \
--workers 10
原生安装的环境要求:
在仓库根目录执行:
uv sync --frozen
uv run python tools/verify_release.py --release-root .
uv run python -m jmangabench build \
--manga109s-root /path/to/Manga109s_released \
--output ./JMangaBench_Mixed \
--workers 10
一键构建程序会验证仓库文件,恢复真实与合成数据,严格检查源数据,并按照固定顺序组装 最终 benchmark。输出目录不能预先存在。
构建结果:
JMangaBench_Mixed/
annotations.jsonl
manifest.json
sha256_warnings.jsonl
images/
real_crops/
synthetic/
masks/
body_text/
所有生成图片与 Linux 参考值一致时,sha256_warnings.jsonl 为空。否则每一行会记录
一个图片路径、参考 SHA-256 和实际 SHA-256。源资产和源 crop 校验失败仍会中止构建。
JMangaBench_Mixed 不会导入或管理模型框架。将
examples/predict_jsonl_template.py 复制到模型自己的环境,并实现
load_model() 和 predict():
cp examples/predict_jsonl_template.py /path/to/model/run_jmangabench.py
/path/to/model/python /path/to/model/run_jmangabench.py \
--benchmark ./JMangaBench_Mixed \
--output ./predictions.jsonl
模型必须为每个 benchmark ID 输出且只输出一个 JSON 对象:
{"id":"jmm_4_8_000001","prediction":"やあ坊主","latency_seconds":0.123,"error":null}
latency_seconds 和 error 可以省略,prediction 必须始终是字符串。
uv run python -m jmangabench validate-predictions \
--benchmark ./JMangaBench_Mixed \
--predictions ./predictions.jsonl
uv run python -m jmangabench evaluate \
--benchmark ./JMangaBench_Mixed \
--predictions ./predictions.jsonl \
--output ./evaluation/my_model
成功后生成:
evaluation/my_model/
report.json
per_sample.jsonl
如果存在缺失、额外或重复 ID,非法 prediction 或延迟,annotation 被修改,或者图片、 mask 哈希不一致,evaluator 会拒绝评分。
冻结的协议为:
jmangabench_mixed_ocr_metrics/v1
jmangabench_mixed_text_normalization/v1
文本规范化执行 Unicode NFKC 并删除空白。忽略标点规则删除 Unicode 标点,但保留
U+30FC(ー)。CER 使用 micro-average,Exact Match 使用样本平均。
每份报告包含总体结果,以及以下切片:
source_kind:真实或合成;subset:真实 crop 或四个合成长度分组;crop_type:真实 crop、文字 crop 或气泡 crop;scene_type:真实 crop、气泡或直接文字;orientation:横排、竖排或 unspecified。如果 prediction 提供延迟,报告还会计算平均、p50 和 p95 延迟。
release_manifest.json 记录全部发布文件的大小和 SHA-256;sha256_warnings.jsonl,并汇总到 manifest.json;annotations.jsonl,evaluator 会在评分前验证;manifest.json 冻结 annotation 和切片数量;redistribution_allowed: false。不得上传本地构建的 benchmark 或任何 Private 验证图片目录。
除非文件或目录另有说明,项目原创代码、文档、配方、元数据和资产采用 GPL-3.0-only。
第三方条款继续有效:
notices/manga_editor_desu_gpl3/;notices/fonts/,采用 SIL Open Font License 1.1;10 commits
Python
99.4%
A reproducible mixed-domain benchmark for Japanese manga OCR.
JMangaBench_Mixed is a relatively easy, reproducible mixed-domain benchmark for Japanese manga OCR that simulates real-world conditions. It evaluates both real manga text and controlled synthetic text. It contains 3,286 samples and reports not only one overall score, but also results by data source, text-length group, crop type, scene type, and writing orientation.
The repository contains the code, recipes, released rendering layers, hashes, and evaluator required to reproduce the benchmark. Manga109-s pixels are not redistributed: users obtain Manga109-s separately and build the image set locally.
| Component | Count | Description |
|---|---|---|
| Total | 3,286 | One image and one reference string per sample |
| Real crops | 1,286 | Locally reconstructed from Manga109-s |
| Synthetic samples | 2,000 | Four groups of 500 |
| Synthetic body-text masks | 2,000 | Furigana is excluded from the body-text mask |
| Orientation | 1,390 vertical / 610 horizontal | Synthetic samples only |
| Crop type | 1,000 text crops / 1,000 balloon crops | Synthetic samples only |
| Scene type | 1,600 balloon / 400 direct text | Synthetic samples only |
crop_type | Crop rule | Balloon scene | Direct-text scene | Total |
|---|---|---|---|---|
text_detector_crop | Body-text mask bounding box plus realized padding | 600 | 400 | 1,000 |
balloon_detector | Full generated canvas; no second crop around the text | 1,000 | 0 | 1,000 |
Both crop types are scored with OCR metrics. No detector metric is computed.
The synthetic groups are:
| Subset | Samples | Configured visible-text range |
|---|---|---|
mixed_4_8 | 500 | 4–8 |
mixed_9_13 | 500 | 9–13 |
mixed_14_18 | 500 | 14–18 |
mixed_19_40 | 500 | 19–40 |
Every group is balanced between 250 text_detector_crop and 250 balloon_detector samples.
The synthetic set uses 28 distinct font files and 82 distinct container assets:
The repository retains 48 GPL SVG sources; 44 of them are used by the final samples. A pool of 1,000 Manga109-s background regions is used twice across the 2,000 synthetic samples.
| Field | Frozen value |
|---|---|
| Source dataset | Manga109-s |
| Source release | Manga109-v2026 |
| Reference package date | 2026-05-21 |
| Annotation source used to prepare the recipes | Current annotations/ included with Manga109-v2026 |
| Manga109-s files read during local reconstruction | images/ only |
| Real-crop source verification | Full-page file SHA-256, page dimensions, and decoded crop pixel SHA-256 are strict checks |
| Synthetic source verification | Page dimensions, source-region pixel SHA-256, foreground SHA-256, and label-layer SHA-256 are strict checks |
| Generated-image verification | Final PNG SHA-256 differences are warnings recorded in sha256_warnings.jsonl |
The version label is recorded as source metadata. A mismatch in a source asset or decoded source crop stops construction. A final generated-image SHA-256 difference does not stop construction and is recorded in the warning report.
The generated-image reference hashes were produced on the following Linux/amd64 system:
| Field | Reference value |
|---|---|
| JMangaBench_Mixed | v1.0.0 |
| OS | Ubuntu 22.04.1 LTS |
| Kernel | 5.15.0-133-generic |
| Architecture | x86_64 |
| CPU | Intel Xeon Platinum 8358P |
| GPU | NVIDIA GeForce RTX 4090, 24 GB; used for OCR inference only, not PNG construction |
| Python | 3.13.14 (Anaconda, GCC 14.3) |
| Pillow | 12.3.0 |
| JPEG codec ABI | 6.2 |
| libjpeg-turbo | 3.1.4.1 |
| zlib | 1.3.2 |
The repository also provides a pinned Linux/amd64 Docker build. Its base image
is ghcr.io/astral-sh/uv@sha256:531f855bda2c73cd6ef67d56b733b357cea384185b3022bd09f05e002cd144ca.
The resulting runtime uses Python 3.13.11, Pillow 12.3.0, JPEG codec ABI 6.2,
libjpeg-turbo 3.1.4.1, and zlib 1.2.13.
Native builds on macOS or Windows can produce a different final PNG byte stream or slightly different generated pixels because image codecs and numerical implementations differ across platforms. Such differences may be visually and OCR-negligible, but SHA-256 alone does not measure their practical effect. The builder therefore reports every affected generated image without treating it as a source-data failure.
The following results were exported on 2026-07-28. All inference was performed on the same Linux server with one NVIDIA GeForce RTX 4090 24 GB GPU. Each model processed one image at a time in canonical benchmark order. Per-image latency does not include model loading and is hardware-dependent.
Two locally constructed image sets were evaluated:
Linux reference: the Linux/amd64 reference construction described above;macOS private: the earlier private construction produced on macOS.Both sets contain the same 3,286 sample IDs and reference strings. The accuracy metrics were identical for each model, so they are reported once:
| Model | CER ↓ | Exact match ↑ | Text-only CER ↓ | Text-only exact match ↑ |
|---|---|---|---|---|
| MangaOCR | 4.683% | 73.524% | 2.700% | 82.867% |
| HayaiOCR | 6.738% | 71.272% | 4.967% | 80.949% |
| BaberuOCR | 4.589% | 72.246% | 2.603% | 81.649% |
| PaddleOCR-VL-0.9B-For-Manga | 2.910% | 78.911% | 1.866% | 84.662% |
Sequential per-image latency on the RTX 4090:
| Model | Linux-reference input mean | Linux-reference p50 | Linux-reference p95 | macOS-private input mean | macOS-private p50 | macOS-private p95 |
|---|---|---|---|---|---|---|
| MangaOCR | 83.0 ms | 74.8 ms | 151.5 ms | 84.6 ms | 77.0 ms | 153.0 ms |
| HayaiOCR | 102.6 ms | 96.3 ms | 175.3 ms | 101.5 ms | 95.3 ms | 172.0 ms |
| BaberuOCR | 103.1 ms | 92.1 ms | 203.7 ms | 104.2 ms | 92.6 ms | 205.8 ms |
| PaddleOCR-VL-0.9B-For-Manga | 242.0 ms | 211.8 ms | 490.6 ms | 246.7 ms | 219.2 ms | 487.7 ms |
Cross-construction prediction comparison:
| Model | Samples | Raw prediction differences | Normalized prediction differences | Metric differences |
|---|---|---|---|---|
| MangaOCR | 3,286 | 0 | 0 | 0 |
| HayaiOCR | 3,286 | 0 | 0 | 0 |
| BaberuOCR | 3,286 | 0 | 0 | 0 |
| PaddleOCR-VL-0.9B-For-Manga | 3,286 | 1 | 0 | 0 |
The single raw PaddleOCR difference for jmm_19_40_000180 consisted only of
inserted line breaks; whitespace normalization made the predictions identical.
Across 13,144 model-sample comparisons, there were no normalized prediction
differences and no metric differences. For these two constructions and four
tested models, the cross-platform image differences had no measurable effect
on the reported OCR accuracy.
Docker is the shortest reference-platform path. Docker Desktop users on macOS
or Windows should keep --platform linux/amd64 in both commands:
docker build --platform linux/amd64 -t jmangabench-mixed:1.0.0 .
mkdir -p /absolute/path/to/output-parent
docker run --rm --platform linux/amd64 \
-v "/absolute/path/to/Manga109s_released_2026_05_21:/data/Manga109s:ro" \
-v "/absolute/path/to/output-parent:/output" \
jmangabench-mixed:1.0.0 \
build \
--manga109s-root /data/Manga109s \
--output /output/JMangaBench_Mixed \
--workers 10
For a native installation, requirements are:
From the repository root:
uv sync --frozen
uv run python tools/verify_release.py --release-root .
uv run python -m jmangabench build \
--manga109s-root /path/to/Manga109s_released \
--output ./JMangaBench_Mixed \
--workers 10
The one-command builder verifies the repository, reconstructs the real and synthetic components, performs strict source checks, and assembles the final benchmark in canonical order. The output directory must not already exist.
Expected output:
JMangaBench_Mixed/
annotations.jsonl
manifest.json
sha256_warnings.jsonl
images/
real_crops/
synthetic/
masks/
body_text/
sha256_warnings.jsonl is empty when every generated image matches the Linux
reference. Otherwise, each line identifies one image, its reference SHA-256,
and its actual SHA-256. Source asset and source-crop failures remain fatal.
JMangaBench_Mixed does not import or manage model frameworks. Copy
examples/predict_jsonl_template.py into the model's own environment and
implement load_model() and predict():
cp examples/predict_jsonl_template.py /path/to/model/run_jmangabench.py
/path/to/model/python /path/to/model/run_jmangabench.py \
--benchmark ./JMangaBench_Mixed \
--output ./predictions.jsonl
The model must produce exactly one JSON object for every benchmark ID:
{"id":"jmm_4_8_000001","prediction":"やあ坊主","latency_seconds":0.123,"error":null}
latency_seconds and error are optional. prediction must always be a string.
uv run python -m jmangabench validate-predictions \
--benchmark ./JMangaBench_Mixed \
--predictions ./predictions.jsonl
uv run python -m jmangabench evaluate \
--benchmark ./JMangaBench_Mixed \
--predictions ./predictions.jsonl \
--output ./evaluation/my_model
Evaluation creates:
evaluation/my_model/
report.json
per_sample.jsonl
The evaluator rejects missing, extra, or duplicate IDs; invalid predictions or latencies; modified annotations; and image or mask hash mismatches.
The frozen protocols are:
jmangabench_mixed_ocr_metrics/v1
jmangabench_mixed_text_normalization/v1
Normalization applies Unicode NFKC and removes whitespace. The text-only policy
removes Unicode punctuation while preserving U+30FC (ー). CER is
micro-averaged; exact match is sample-averaged.
Each report contains overall results and slices by:
source_kind: real or synthetic;subset: real crops or one of the four synthetic length groups;crop_type: real crop, text crop, or balloon crop;scene_type: real crop, balloon, or direct text;orientation: horizontal, vertical, or unspecified.When latency is provided, the report also includes mean, p50, and p95 latency.
release_manifest.json records every distributable file's size and SHA-256.sha256_warnings.jsonl and summarized in manifest.json.annotations.jsonl and checked
by the evaluator before scoring.manifest.json freezes annotations and slice counts.redistribution_allowed: false.Do not upload the locally built benchmark or any private verification image directory.
Project-authored code, documentation, recipes, metadata, and assets are licensed under GPL-3.0-only, unless a file or directory says otherwise.
Third-party terms remain in effect:
notices/manga_editor_desu_gpl3/;notices/fonts/ under SIL Open Font License
1.1;See THIRD_PARTY_NOTICES.md for details.
JMangaBench_Mixed 是一个面向日文漫画 OCR 的模拟真实情况的较简单的可复现混合域评测集。它同时测试真实漫画文字与可控合成文字,共包含 3,286 个样本。
本仓库提供复现 benchmark 所需的代码、配方、发布渲染层、哈希和 evaluator,不重新分发 Manga109-s 像素。用户需要单独取得 Manga109-s,并在本地构建图片测试集。
| 组成 | 数量 | 说明 |
|---|---|---|
| 总计 | 3,286 | 每个样本包含一张图片和一个正文答案 |
| 真实 crop | 1,286 | 在本地从 Manga109-s 恢复 |
| 合成样本 | 2,000 | 四组,每组 500 张 |
| 合成正文 mask | 2,000 | 正文 mask 不包含 furigana |
| 文字方向 | 竖排 1,390 / 横排 610 | 仅统计合成样本 |
| Crop 类型 | 文字 crop 1,000 / 气泡 crop 1,000 | 仅统计合成样本 |
| 场景类型 | 气泡 1,600 / 直接文字 400 | 仅统计合成样本 |
crop_type | 裁剪规则 | 气泡场景 | 直接文字场景 | 合计 |
|---|---|---|---|---|
text_detector_crop | 正文 mask 包围框加实际 padding | 600 | 400 | 1,000 |
balloon_detector | 保留完整生成画布,不围绕正文二次裁剪 | 1,000 | 0 | 1,000 |
两种 crop 均使用 OCR 指标评分,不计算检测器指标。
四个合成分组为:
| 子集 | 样本数 | 配置的可见文字范围 |
|---|---|---|
mixed_4_8 | 500 | 4–8 |
mixed_9_13 | 500 | 9–13 |
mixed_14_18 | 500 | 14–18 |
mixed_19_40 | 500 | 19–40 |
每组均包含 250 张 text_detector_crop 和 250 张 balloon_detector。 |
合成样本实际使用 28 个不同的字体文件和 82 个不同的容器资产:
仓库保留了 48 个 GPL SVG 源文件,其中 44 个实际进入最终样本。合成数据使用 1,000 个 Manga109-s 背景区域,每个背景在 2,000 张样本中使用两次。
| 字段 | 冻结值 |
|---|---|
| 来源数据集 | Manga109-s |
| 来源版本 | Manga109-v2026 |
| 参考数据包日期 | 2026-05-21 |
| 生成配方时使用的 annotation | Manga109-v2026 中当前的 annotations/ |
| 本地重建时读取的 Manga109-s 文件 | 仅 images/ |
| 真实 crop 来源验证 | 完整页面文件 SHA-256、页面尺寸和解码后 crop 像素 SHA-256 均为严格校验 |
| 合成来源验证 | 页面尺寸、源区域像素 SHA-256、foreground SHA-256 和 label layer SHA-256 均为严格校验 |
| 生成图片验证 | 最终 PNG SHA-256 差异仅作 Warning,并写入 sha256_warnings.jsonl |
版本名称作为来源元数据记录。源资产或解码后源 crop 不一致时构建会立即失败;仅最终 生成图片 SHA-256 不一致时不会中止,而是写入 Warning 报告。
最终生成图片的参考哈希来自以下 Linux/amd64 环境:
| 字段 | 参考值 |
|---|---|
| JMangaBench_Mixed | v1.0.0 |
| 操作系统 | Ubuntu 22.04.1 LTS |
| 内核 | 5.15.0-133-generic |
| 架构 | x86_64 |
| CPU | Intel Xeon Platinum 8358P |
| GPU | NVIDIA GeForce RTX 4090,24 GB;仅用于 OCR 推理,不参与 PNG 构建 |
| Python | 3.13.14(Anaconda,GCC 14.3) |
| Pillow | 12.3.0 |
| JPEG codec ABI | 6.2 |
| libjpeg-turbo | 3.1.4.1 |
| zlib | 1.3.2 |
仓库同时提供固定的 Linux/amd64 Docker 构建,基础镜像为
ghcr.io/astral-sh/uv@sha256:531f855bda2c73cd6ef67d56b733b357cea384185b3022bd09f05e002cd144ca。
容器运行时使用 Python 3.13.11、Pillow 12.3.0、JPEG codec ABI 6.2、
libjpeg-turbo 3.1.4.1 和 zlib 1.2.13。
在 macOS 或 Windows 上原生构建时,图片编解码器和数值实现的跨平台差异可能改变最终 PNG 字节流,或造成轻微的生成像素差异。这类差异对肉眼观感和 OCR prediction 的影响 可能很小,但 SHA-256 本身不能衡量实际影响。因此构建器会列出所有受影响的生成图片, 但不会把它们判定为源数据错误。
以下结果导出于 2026-07-28。全部推理均在同一台 Linux 服务器上使用一张 NVIDIA GeForce RTX 4090 24 GB GPU 完成。每个模型按照 benchmark 固定顺序逐张处理图片。 单张延迟不包含模型加载时间,并且与硬件相关。
本次评测使用两套本地构建图片:
Linux reference:使用上文 Linux/amd64 参考环境构建;macOS private:此前在 macOS 上构建的 private 版本。两套图片包含相同的 3,286 个样本 ID 和 reference。每个模型在两套图片上的准确率指标 完全相同,因此只展示一次:
| 模型 | CER ↓ | Exact Match ↑ | 忽略标点 CER ↓ | 忽略标点 EM ↑ |
|---|---|---|---|---|
| MangaOCR | 4.683% | 73.524% | 2.700% | 82.867% |
| HayaiOCR | 6.738% | 71.272% | 4.967% | 80.949% |
| BaberuOCR | 4.589% | 72.246% | 2.603% | 81.649% |
| PaddleOCR-VL-0.9B-For-Manga | 2.910% | 78.911% | 1.866% | 84.662% |
RTX 4090 上的逐张推理延迟:
| 模型 | Linux-reference 输入平均 | Linux-reference p50 | Linux-reference p95 | macOS-private 输入平均 | macOS-private p50 | macOS-private p95 |
|---|---|---|---|---|---|---|
| MangaOCR | 83.0 ms | 74.8 ms | 151.5 ms | 84.6 ms | 77.0 ms | 153.0 ms |
| HayaiOCR | 102.6 ms | 96.3 ms | 175.3 ms | 101.5 ms | 95.3 ms | 172.0 ms |
| BaberuOCR | 103.1 ms | 92.1 ms | 203.7 ms | 104.2 ms | 92.6 ms | 205.8 ms |
| PaddleOCR-VL-0.9B-For-Manga | 242.0 ms | 211.8 ms | 490.6 ms | 246.7 ms | 219.2 ms | 487.7 ms |
跨构建 prediction 对比:
| 模型 | 样本数 | 原始 prediction 差异 | 规范化 prediction 差异 | 指标差异 |
|---|---|---|---|---|
| MangaOCR | 3,286 | 0 | 0 | 0 |
| HayaiOCR | 3,286 | 0 | 0 | 0 |
| BaberuOCR | 3,286 | 0 | 0 | 0 |
| PaddleOCR-VL-0.9B-For-Manga | 3,286 | 1 | 0 | 0 |
PaddleOCR 唯一一条原始差异出现在 jmm_19_40_000180,内容仅为插入换行;删除空白后
两条 prediction 完全相同。四个模型共 13,144 次样本对比中,规范化 prediction 差异
为 0,评测指标差异也为 0。对于本次对比的两套构建和四个模型,跨平台图片差异没有对
报告中的 OCR 准确率产生可测量影响。
Docker 是最短的参考平台构建方式。在 macOS 或 Windows 的 Docker Desktop 上也应在
两条命令中保留 --platform linux/amd64:
docker build --platform linux/amd64 -t jmangabench-mixed:1.0.0 .
mkdir -p /absolute/path/to/output-parent
docker run --rm --platform linux/amd64 \
-v "/absolute/path/to/Manga109s_released_2026_05_21:/data/Manga109s:ro" \
-v "/absolute/path/to/output-parent:/output" \
jmangabench-mixed:1.0.0 \
build \
--manga109s-root /data/Manga109s \
--output /output/JMangaBench_Mixed \
--workers 10
原生安装的环境要求:
在仓库根目录执行:
uv sync --frozen
uv run python tools/verify_release.py --release-root .
uv run python -m jmangabench build \
--manga109s-root /path/to/Manga109s_released \
--output ./JMangaBench_Mixed \
--workers 10
一键构建程序会验证仓库文件,恢复真实与合成数据,严格检查源数据,并按照固定顺序组装 最终 benchmark。输出目录不能预先存在。
构建结果:
JMangaBench_Mixed/
annotations.jsonl
manifest.json
sha256_warnings.jsonl
images/
real_crops/
synthetic/
masks/
body_text/
所有生成图片与 Linux 参考值一致时,sha256_warnings.jsonl 为空。否则每一行会记录
一个图片路径、参考 SHA-256 和实际 SHA-256。源资产和源 crop 校验失败仍会中止构建。
JMangaBench_Mixed 不会导入或管理模型框架。将
examples/predict_jsonl_template.py 复制到模型自己的环境,并实现
load_model() 和 predict():
cp examples/predict_jsonl_template.py /path/to/model/run_jmangabench.py
/path/to/model/python /path/to/model/run_jmangabench.py \
--benchmark ./JMangaBench_Mixed \
--output ./predictions.jsonl
模型必须为每个 benchmark ID 输出且只输出一个 JSON 对象:
{"id":"jmm_4_8_000001","prediction":"やあ坊主","latency_seconds":0.123,"error":null}
latency_seconds 和 error 可以省略,prediction 必须始终是字符串。
uv run python -m jmangabench validate-predictions \
--benchmark ./JMangaBench_Mixed \
--predictions ./predictions.jsonl
uv run python -m jmangabench evaluate \
--benchmark ./JMangaBench_Mixed \
--predictions ./predictions.jsonl \
--output ./evaluation/my_model
成功后生成:
evaluation/my_model/
report.json
per_sample.jsonl
如果存在缺失、额外或重复 ID,非法 prediction 或延迟,annotation 被修改,或者图片、 mask 哈希不一致,evaluator 会拒绝评分。
冻结的协议为:
jmangabench_mixed_ocr_metrics/v1
jmangabench_mixed_text_normalization/v1
文本规范化执行 Unicode NFKC 并删除空白。忽略标点规则删除 Unicode 标点,但保留
U+30FC(ー)。CER 使用 micro-average,Exact Match 使用样本平均。
每份报告包含总体结果,以及以下切片:
source_kind:真实或合成;subset:真实 crop 或四个合成长度分组;crop_type:真实 crop、文字 crop 或气泡 crop;scene_type:真实 crop、气泡或直接文字;orientation:横排、竖排或 unspecified。如果 prediction 提供延迟,报告还会计算平均、p50 和 p95 延迟。
release_manifest.json 记录全部发布文件的大小和 SHA-256;sha256_warnings.jsonl,并汇总到 manifest.json;annotations.jsonl,evaluator 会在评分前验证;manifest.json 冻结 annotation 和切片数量;redistribution_allowed: false。不得上传本地构建的 benchmark 或任何 Private 验证图片目录。
除非文件或目录另有说明,项目原创代码、文档、配方、元数据和资产采用 GPL-3.0-only。
第三方条款继续有效:
notices/manga_editor_desu_gpl3/;notices/fonts/,采用 SIL Open Font License 1.1;10 commits
Python
99.4%