Skip to content
ModelListedExternal
Download

Yolov11x Komonjo Char

kuzushiji-db-derived-rights-reserved

KindOtherBase modelUltralytics/YOLO11VersionRevision 90c8a3a

Model source

Kind
Other
File size
217–435 MB
Base model
Ultralytics/YOLO11
Version
vRevision 90c8a3a
Updated
Sep 22, 2026
Downloads
2
Source
Hugging Face

Source description

yolov11x-komonjo-char — くずし字(古文書)文字検出 YOLOv11x

古文書(中近世の手書き文書)のくずし字を 1文字ずつの矩形 (単一クラス char) で検出する YOLOv11x。 東京大学史料編纂所「電子くずし字字典データベース」由来の古文書文字データで学習。

姉妹モデル yolov11x-codh-char(CODH 日本古典籍くずし字で学習) の 古文書版 にあたる。御内書など連綿草書の古文書で codh 版を大きく上回る。

🚀 デモ / Demo: kuzushiji-char-segmentation — インストール不要でブラウザから試せます(高解像度画像は SAHI タイル推論を自動選択)。 Try the model in your browser — no installation required (SAHI tiling is selected automatically for high-resolution images).

English: YOLOv11x detector that localizes individual kuzushiji (cursive) characters in pre-modern Japanese handwritten documents (komonjo) as single-class (char) bounding boxes. Trained on character data derived from the Electronic Kuzushiji Dictionary Database of the Historiographical Institute, the University of Tokyo. It is the komonjo counterpart of yolov11x-codh-char (trained on classical books), and substantially outperforms it on cursive documents such as gonaisho letters. Detection only — no character recognition or reading-order estimation.

権利・ライセンス / License

⚠️ 学習データは東京大学史料編纂所「電子くずし字字典データベース」由来で、元データセットは非公開・権利留保です。 本モデル重みは other (kuzushiji-db-derived-rights-reserved) 扱いです。

  • 非営利の学術研究・教育目的での利用(推論・評価・ファインチューニング)は、出典明記の上で可能です。
  • 商用利用・重みの再配布は事前に確認してください(本リポジトリの Community タブ へ)。
  • 詳細は LICENSE を参照してください。

English: Trained on data derived from the rights-reserved kuzushiji dictionary database of the Historiographical Institute. Non-commercial academic research and educational use is permitted with attribution. For commercial use or weight redistribution, please ask first via the Community tab. See LICENSE for details.

ファイル / Files

ファイル内容
best.ptUltralytics 重み (YOLOv11x, single class char)。from ultralytics import YOLO; YOLO("best.pt")
best.onnxONNX 版 (opset 12)。入力 images [batch,3,H,W] (batch/H/W すべて dynamic) / 出力 output0 [batch,5,N] (cx,cy,w,h,score の生出力 — NMS 必須)。imgsz=1280 で学習だが dynamic のため 1024 タイル(SAHI)等にも対応。ブラウザ/onnxruntime 推論用

推論パラメタ目安 / Suggested parameters: conf=0.25, iou=0.45, imgsz=1280(高解像度では SAHI タイル推論推奨 / use SAHI tiling for high-resolution images)。

使い方 / Usage

Python (Ultralytics) — 最短 / quickest

from huggingface_hub import hf_hub_download
from ultralytics import YOLO

weights = hf_hub_download("nakamura196/yolov11x-komonjo-char", "best.pt")
model = YOLO(weights)

results = model.predict("page.jpg", conf=0.25, iou=0.45, imgsz=1280)
print(results[0].boxes.xyxy)   # character boxes (x1, y1, x2, y2) in original image coords
results[0].save("page_pred.jpg")

高解像度画像 — SAHI タイル推論 / SAHI sliced inference

長辺 2000px を超えるような画像は、縮小で文字が潰れる前にタイル推論する方が recall が出ます。 For large scans, tiled inference preserves small characters that plain resizing would destroy.

from sahi import AutoDetectionModel
from sahi.predict import get_sliced_prediction

det = AutoDetectionModel.from_pretrained(
    model_type="ultralytics", model_path=weights,
    confidence_threshold=0.25, device="cpu")   # or "cuda:0"

result = get_sliced_prediction(
    "large_page.jpg", det,
    slice_height=1024, slice_width=1024,
    overlap_height_ratio=0.2, overlap_width_ratio=0.2)
result.export_visuals(export_dir="out/")

ONNX (onnxruntime) — 前処理・後処理込み / full pre/post-processing

output0 は NMS 前の生出力です。letterbox → 推論 → 閾値 → NMS → 座標復元まで含めた完全な例: output0 is raw (pre-NMS). Complete example including letterbox, thresholding, NMS, and coordinate restoration:

import cv2
import numpy as np
import onnxruntime as ort
from huggingface_hub import hf_hub_download

CONF, IOU, SIZE = 0.25, 0.45, 1280

def letterbox(im, size=SIZE):
    h, w = im.shape[:2]
    r = min(size / h, size / w)
    nh, nw = round(h * r), round(w * r)
    canvas = np.full((size, size, 3), 114, np.uint8)
    top, left = (size - nh) // 2, (size - nw) // 2
    canvas[top:top + nh, left:left + nw] = cv2.resize(im, (nw, nh))
    return canvas, r, left, top

img = cv2.imread("page.jpg")
inp, r, dx, dy = letterbox(img)
x = inp[:, :, ::-1].transpose(2, 0, 1)[None].astype(np.float32) / 255.0  # BGR→RGB, NCHW, 0–1

onnx_path = hf_hub_download("nakamura196/yolov11x-komonjo-char", "best.onnx")
sess = ort.InferenceSession(onnx_path)
cx, cy, w, h, score = sess.run(None, {"images": x})[0][0]   # (5, N)

keep = score > CONF
boxes = np.stack([cx - w / 2, cy - h / 2, w, h], 1)[keep]   # x,y,w,h (letterbox coords)
idx = cv2.dnn.NMSBoxes(boxes.tolist(), score[keep].tolist(), CONF, IOU)
H, W = img.shape[:2]
for i in np.asarray(idx).flatten():
    bx, by, bw, bh = boxes[i]
    x1, y1 = (bx - dx) / r, (by - dy) / r                   # back to original image coords
    x2, y2 = (bx + bw - dx) / r, (by + bh - dy) / r
    x1, y1 = max(0, x1), max(0, y1)                         # clip to image bounds
    x2, y2 = min(W, x2), min(H, y2)
    print(round(x1), round(y1), round(x2), round(y2))

ブラウザ (onnxruntime-web / WebGPU) でも同じ前処理・後処理で動作します。 The same pre/post-processing works in the browser with onnxruntime-web (WebGPU/WASM).

学習 / Training

  • ベース: yolo11x.pt (Ultralytics 8.4.62) / 単一クラス char / imgsz=1280 / epochs=100(採用 best = epoch 73)。NVIDIA A100。
  • データ: 電子くずし字字典データベース由来の検出データセット(dataset_masked: train 877 / val 115 / test 115、未注釈領域はマスク)。
  • ONNX export: yolo export model=best.pt format=onnx opset=12 dynamic=True imgsz=1280

Base yolo11x.pt, single class, imgsz 1280, 100 epochs (best at epoch 73) on an A100, using a detection dataset derived from the database above (877/115/115 train/val/test; unannotated regions masked).

評価 / Evaluation

test split (masked, 115枚) — 同一 test での公平比較

モデルmAP50mAP50-95PrecisionRecall
yolov11x-komonjo (本モデル)0.7030.5270.9560.712
yolov12x-komonjo (比較用)0.6950.5050.9450.704
yolov11x-codh (典籍, baseline)0.5410.2430.8170.565

→ 古文書学習により mAP50-95 が 典籍 0.243 → 0.527 (2.2倍)。 注: この test split は同一文書が train/test に跨るため数値はやや楽観的。 Note: documents can span train/test in this split, so these numbers are somewhat optimistic.

このほか、学習外の自筆書状(連綿草書)に対する人手GTでの評価や、学習データと無関係な所蔵の古文書群での定性確認でも、典籍モデルに対する明確な優位を確認している。 The advantage over the codh baseline has also been confirmed on held-out autograph cursive letters evaluated against hand-made ground truth, and qualitatively on document collections unrelated to the training data.

できないこと・制約 / Limitations

  • 検出のみ: どの文字かの認識・読み順の推定は行わない。文字認識は別モデル(単字分類器等)と組み合わせること。
  • 学習データは中近世の手書き古文書。版本・整版・活字・近代文書は未検証(古典籍は姉妹モデル codh 版を推奨)。
  • Recall は test split で 0.71。取りこぼし前提で、翻刻等の用途では人手確認を挟むこと。conf を下げると recall は上がるが誤検出も増える。
  • 朱印・花押・虫損・端裏書・定規などの周辺要素で誤検出/未検出があり得る。
  • 低解像度では文字が潰れて recall が落ちる。高解像度原本は SAHI タイル推論を推奨。

English: Detection only (no recognition / reading order). Trained on handwritten komonjo; unverified on printed books or modern documents. Recall ≈ 0.71 — expect misses and keep a human in the loop. Seals, kaō monograms, wormholes, and rulers in the frame can cause false positives/negatives. Use SAHI tiling for high-resolution scans.

引用 / Citation

@misc{nakamura2026yolov11xkomonjochar,
  author       = {Nakamura, Satoru},
  title        = {yolov11x-komonjo-char: YOLOv11x kuzushiji character detection
                  for pre-modern Japanese documents (komonjo)},
  year         = {2026},
  publisher    = {Hugging Face},
  howpublished = {\url{https://huggingface.co/nakamura196/yolov11x-komonjo-char}}
}

学習データ原典として「東京大学史料編纂所 電子くずし字字典データベース」も併せて言及してください。 Please also acknowledge the source database (Historiographical Institute, the University of Tokyo) when citing.

出典・謝辞 / Acknowledgements

  • 学習データ原典: 東京大学史料編纂所 電子くずし字字典データベース / 画像 IIIF (clioimg.hi.u-tokyo.ac.jp)
  • 検出器: Ultralytics YOLO11

Sources

1 source
Hugging FacePrimaryVersion 90c8a3a2df4ef49e7135b2a33388bcdc3cb0129d
huggingface.co/nakamura196/yolov11x-komonjo-char/tree/90c8a3a2df4ef49e7135b2a33388bcdc3cb0129d

Verified Sep 9

Model artifacts

2 artifacts

best.onnx

onnx · 217 MB · SHA-256 daf523b4134e…f286 · Hugging Face

Download

best.pt

pt · 435 MB · SHA-256 e50be51257f0…1e1a · Hugging Face

Download

Source excerpts

2 excerpts

--- license: other license_name: kuzushiji-db-derived-rights-reserved license_link: LICENSE language: - ja library_name: ultralytics pipeline_tag: object-detection tags: - kuzushiji - japanese - historical-documents - komonjo - text-detection - yolo - yolov11 base_model: - Ultralytics/YOLO11 model-index: - name: yolov11x-komonjo-char results: - task: type: object-detection dataset: type: komonjo-char-masked name: Komonjo char detection dataset (masked), test split metrics: - type: map50 value: 0.703 name: mAP@50 - type: map value: 0.527 name: mAP@50-95 - type: precision value: 0.956 name: Precision - type: recall value: 0.712 name: Recall --- # yolov11x-komonjo-char — くずし字(古文書)文字検出 YOLOv11x 古文書(中近世の手書き文書)のくずし字を **1文字ずつの矩形 (単一クラス `char`)** で検出する YOLOv11x。 東京大学史料編纂所「電子くずし字字典データベース」由来の古文書文字データで学習。 姉妹モデル [`yolov11x-codh-char`](https://huggingface.co/nakamura196/yolov11x-codh-char)(CODH 日本**古典籍**くずし字で学習) の **古文書版** にあたる。御内書など連綿草書の古文書で codh 版を大きく上回る。 🚀 **デモ / Demo**: [`kuzushiji-char-segmentation`](https://huggingface.co/spaces/nakamura196/kuzushiji-char-segmentation) — インストール不要でブラウザから試せます(高解像度画像は SAHI タイル推論を自動選択)。 Try the model in your browser — no installation required (SAHI tiling is selected automatically for high-resolution images). **English**: YOLOv11x detector that localizes individual *kuzushiji* (cursive) characters in pre-modern Japanese handwritten documents (*komonjo*) as single-class (`char`) bounding boxes. Trained on character data derived from the Electronic Kuzushiji Dictionary Database of the Historiographical Institute, the University of Tokyo. It is the *komonjo* counterpart of [`yolov11x-codh-char`](https://huggingface.co/nakamura196/yolov11x-codh-char) (trained on classical *books*), and substantially outperforms it on cursive documents such as *gonaisho* letters. Detection only — no character recognition or reading-order estimation. ## 権利・ライセンス / License > ⚠️ 学習データは東京大学史料編纂所「電子くずし字字典データベース」由来で、元データセットは非公開・権利留保です。 > 本モデル重みは `other (kuzushiji-db-derived-rights-reserved)` 扱いです。 > > - **非営利の学術研究・教育目的**での利用(推論・評価・ファインチューニング)は、出典明記の上で可能です。 > - **商用利用・重みの再配布**は事前に確認してください(本リポジトリの **Community タブ** へ)。 > - 詳細は [LICENSE](LICENSE) を参照してください。 > > **English**: Trained on data derived from the rights-reserved kuzushiji dictionary database of the Historiographical Institute. **Non-commercial academic research and educational...

Source context: 2 downloads · 0 likes · Pipeline object-detection · Library ultralytics · Repo nakamura196/yolov11x-komonjo-char