Views
No views yet
Armaggheddon/yolo26-document-layout
(yolo26m_doc_layout.pt), a DocLayNet-trained document-layout detector. All
credit for the weights goes to that repository; this one only changes the
container format..pt is ultralytics, which is AGPL-3.0 and cannot ship inside a proprietary
image. The ONNX graph runs on onnxruntime (MIT), so exporting once separates
the license of the model from the license of the loader. Nothing downstream
needs ultralytics or torch.| File | Size | Export |
|---|---|---|
yolo26m_doc_layout.onnx | 82 MB | imgsz=1280, opset=17, simplify=True |
sha256 b143fbb74dbd24ae5b7ebf7b94e78983e02660e4175242b2d2a0f83575848373names metadata, so class ids map to labels without
being told the order — 11 DocLayNet classes:Caption, Footnote, Formula, List-item, Page-footer, Page-header,
Picture, Section-header, Table, Text, Title1curl -fsSL -o yolo26m_doc_layout.onnx \
2 https://huggingface.co/superchaintech/yolo26m-doc-layout-onnx/resolve/main/yolo26m_doc_layout.onnx
3echo "b143fbb74dbd24ae5b7ebf7b94e78983e02660e4175242b2d2a0f83575848373 yolo26m_doc_layout.onnx" | sha256sum -c1import numpy as np, onnxruntime
2from PIL import Image
3
4session = onnxruntime.InferenceSession(
5 "yolo26m_doc_layout.onnx", providers=["CPUExecutionProvider"],
6)
7# letterbox your page to 1280x1280, CHW, float32 /255, then:
8# outputs = session.run(None, {session.get_inputs()[0].name: batch})sc_toolkit, which wraps
letterboxing, NMS and the label mapping:1import os
2os.environ["SC_LAYOUT_MODEL_DIR"] = "/opt/layout"
3from sc_toolkit.vlm.hybrid.detectors import load_onnx_detector
4
5detector = load_onnx_detector("yolo26m_doc_layout.onnx")
6regions = detector.detect(page_image, 0.25) # 0.25 is the YOLO calibrationmin_conf matters: 0.25 is the calibration for this backend. 0.5 is the
PP-DocLayoutV3 number and drops span coverage to ~79%.min_conf=0.25: 78 regions found, no empty page, top confidences
0.84–0.99.1pip install ultralytics huggingface_hub onnx
2python -c "from huggingface_hub import hf_hub_download; from ultralytics import YOLO; \
3 w = hf_hub_download('Armaggheddon/yolo26-document-layout', 'yolo26m_doc_layout.pt'); \
4 print(YOLO(w).export(format='onnx', imgsz=1280, opset=17, simplify=True))"