Markdownで表示

PP-DocLayoutV3

PP-DocLayoutV3は、PaddleOCRのドキュメントレイアウト検出器です。ページの領域(テキスト、タイトル、表、図、数式、ヘッダー、フッター、印影など)を検出し、読み順に並べます。LibreYOLOはこれを、transformersやPaddlePaddleのランタイムを必要としないdetectファミリーとして移植しています。

タスク
detection
サイズ
l at 800 px
インストール
pip install libreyolo
サポートティア
推論のみ、v1.8.0以降。推論、検証、エクスポートのみです。学習機能は対象外です。
アップストリーム
PaddlePaddle AuthorsのPP-DocLayoutV3、Apache-2.0。論文、ソース
ライセンス
コード:Apache-2.0、重み:Apache-2.0。商用利用

インストール

PP-DocLayoutV3にオプションのextraは不要です。純粋なPyTorchで、インポートするものはすべて基本インストールに含まれます。

bash
pip install libreyolo

推論

重みは初回使用時にLibreYOLO/LibrePPDocLayoutV3lからダウンロードされます。

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibrePPDocLayoutV3l.pt")result = model("page.png", conf=0.5)    # アップストリームのパイプラインのしきい値 for order, box, cls, score in zip(    result.reading_order, result.boxes.xyxy, result.boxes.cls, result.boxes.conf):    print(int(order), result.names[int(cls)], round(float(score), 3), box.tolist())
CLI
libreyolo predict model=LibrePPDocLayoutV3l.pt source=page.png conf=0.5 save=True
公式の重み
from libreyolo import LibreYOLO # アップストリームのmodel.safetensorsも読み込み可能、一度だけ変換して# その隣にLibreYOLOのチェックポイントを書き出すmodel = LibreYOLO("model.safetensors")

Results.boxesは、元のページ上のxyxyボックス、信頼度、25のレイアウトクラスに対するクラスIDを保持します。行は読み順に並べられ、Results.reading_orderはボックスに対応する1始まりのint64ベクトルです。track_idと同じくresults[i]でスライスでき、Results.summary()の行にはreading_orderとして現れます。順位はconfで残った領域の間で計算されます。classes=フィルターやmax_detによる打ち切りは残った順位を維持するため、値が飛ぶことがあります。

アップストリームのパイプラインはconf=0.5を使います。LibreYOLOのデフォルトのconf=0.25では、信頼度の低い領域がより多く残ります。アップストリームと同じく、スコアはクラスごとのシグモイドで、上位300の(クエリ、クラス)ペアが保持されるため、1つの領域が2つのラベルで報告されることがあります。NMSは適用されません。

クラス:abstract、algorithm、aside_text、chart、content、display_formula、doc_title、figure_title、footer、footer_image、footnote、formula_number、header、header_image、image、inline_formula、number、paragraph_title、reference、reference_content、seal、table、text、vertical_text、vision_footnote。

同じ移植版が、layout=Trueを指定したFalcon OCRのレイアウト段を実行します。

バリアント

サイズはlの1つです。HGNetV2-Lバックボーン、マスク強化型のクエリ初期化、領域のすべてのペアをスコア付けするglobal-pointerヘッドを備えた、RT-DETR方式の集合予測検出器です。入力は800x800固定のキャンバスです(引き伸ばしリサイズ、[0, 1]のRGB、正規化なし)。CPU、CUDA、MPSで動作します。MPSでは位置エンコーディングをfloat32で計算するため、結果の末尾のビットが異なることがあります。

transformersのApache-2.0のPyTorchリファレンスと比べて、CUDA上のfp32で同じ入力テンソルを与えると、3つの実ページとランダムなテンソルでlogits、ボックス、読み順のlogits、マスクが完全に一致します。学習は提供していません。読み順と領域ごとのマスクの教師データが必要ですが、LibreYOLOのdetectデータセットにはそれがありません。アップストリームがマスク分岐から導出する領域ごとのポリゴンは公開していません。

エクスポート

タスクONNXTorchScriptExecuTorchTensorRTOpenVINOPaddleMNNRKNNAxelerancnnTFLiteCoreMLCore AI
DetectionDetection to ONNX:対応Detection to TorchScript:対応Detection to ExecuTorch:対応Detection to TensorRT:対応Detection to OpenVINO:対応Detection to Paddle:非対応Detection to MNN:非対応Detection to RKNN:非対応Detection to Axelera:非対応Detection to ncnn:非対応Detection to TFLite:非対応Detection to CoreML:非対応Detection to Core AI:非対応

ONNX(opset 17)とTorchScriptで、800x800固定、FP32です。グラフはpred_logits、pred_boxes、order_votesを出力します。エクスポートしたバックエンドはreading_orderを含む同じResultsを返します。

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibrePPDocLayoutV3l.pt")model.export(format="onnx")             # 800x800固定、FP32model.export(format="torchscript")
CLI
libreyolo export model=LibrePPDocLayoutV3l.pt format=onnx
エクスポートしたファイルを使う
from libreyolo import LibreYOLO model = LibreYOLO("LibrePPDocLayoutV3l.onnx")result = model("page.png", conf=0.5)print(result.reading_order)

チェックポイント

ファイル入力(px)重みのライセンス
Detection
LibrePPDocLayoutV3l.pt800apache-2.0

上記のすべてのファイルは現在LibreYOLO orgにあり、初回使用時にダウンロードされます。

ライセンス

ダウンロードする特定の重みについて、Hugging Faceリポジトリのライセンスを確認してください。LibreYOLO orgの各チェックポイントにはライセンスが付与されており、同じファミリー内でも常に同一とは限りません。そのリポジトリが正式な情報源です。以下の概要は、このページを最後に検証した時点で適用されていた内容を示します。

これは関連するライセンスの説明であり、法的助言ではありません。商用上重要な場合は、自分でライセンスを読み、専門家の助言を受けてください。

原著作物
PP-DocLayoutV3, PaddlePaddle Authors
アップストリームのライセンス
Apache-2.0
アップストリームのソース
github.com/PaddlePaddle/PaddleOCR
LibreYOLOのコード
MIT
重み
Apache-2.0、huggingface.co/LibreYOLOで再公開
解釈
Apache-2.0 is a permissive license, so the PP-DocLayoutV3 weights and LibreYOLO's port can be used in commercial and closed-source products. Redistributing them means keeping the license text and attribution notices, and the license grants a patent license. LibreYOLO's network is an inference-only PyTorch port of the Apache-2.0 reference in Hugging Face Transformers (v5.22.1, commit 446a570e62b04a89ea001604ada7366baac2ea67, Copyright The PaddlePaddle Team and The HuggingFace Inc. team) and needs no transformers runtime (libreyolo/models/ppdoclayoutv3/NOTICE). The checkpoint is converted from PaddlePaddle/PP-DocLayoutV3_safetensors at revision e4f489dc536556fc1be02b973ba06756e0d4a2ac, declared Apache-2.0 by its model card; that repository ships no LICENSE file, so the mirror at LibreYOLO/LibrePPDocLayoutV3l carries the Apache-2.0 text of the PaddleOCR project. Conversion only strips a key prefix and adds metadata; learned parameters are unchanged, and the mirror is not gated.

PP-DocLayoutV3はPaddlePaddle AuthorsによるApache-2.0で、コードと重みの両方が対象です。商用利用が可能です。チェックポイントはPaddlePaddle/PP-DocLayoutV3_safetensorsから、キーの接頭辞を取り除きメタデータを追加して変換したものです。学習済みパラメータは変更しておらず、ミラーはゲートされていません。

引用

@misc{cui2026rtdoclayoutrealtimeendtoenddocument,
      title={RT-DocLayout: Real-Time End-to-End Document Layout Analysis with Reading Order in the Wild}, 
      author={Cheng Cui and Tingquan Gao and Xueqing Wang and Changda Zhou and Hongen Liu and Ting Sun and Yubo Zhang and Zelun Zhang and Jiaxuan Liu and Manhui Lin and Yue Zhang and Suyin Liang and Yiqing Xiang and Yi Liu},
      year={2026},
      eprint={2606.23344},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2606.23344}, 
}

著者によるhuggingface.co/PaddlePaddle/PP-DocLayoutV3_safetensors#citationの引用ブロックからコピーしています。

LibreYOLO v1.8.0で検証済みです。このページのサポート表、チェックポイント、ベンチマーク値は手作業で記述したものではなく、リリース済みライブラリと公開済みの重みから生成されています。