PaddleOCR 3.5:Transformers バックエンドによる OCR および文書解析タスクの実行
PaddleOCR がバージョン 3.5 にアップデートされ、Transformer ベースのバックエンドを導入することで、文書解析タスクにおける精度と柔軟性が大幅に向上しました。
キーポイント
Transformer ベースへの移行
従来の CNN 中心のアプローチから、より高度な Transformer アーキテクチャをバックエンドとして採用し、複雑な文書構造の理解能力を強化しました。
高精度な文書解析の実現
OCR とドキュメントパーシング(構造化データ抽出)を統合的に処理する能力が向上し、レイアウト分析やセマンティック理解の精度が高まりました。
Hugging Face エコシステムとの連携強化
Hugging Face Blog を通じて発表され、同プラットフォーム上のモデルやツールとのシームレスな統合を可能にする新機能が提供されました。
Transformers ベースエンドの追加
PaddleOCR 3.5 では、PP-OCRv5 や PaddleOCR-VL 1.5 などのモデルを Hugging Face 環境に自然に統合できるよう、Inference backend layer に Transformers をサポートしました。
RAG と Document AI への利点
PDF やスキャン文書を構造化データに変換する工程の摩擦を減らし、LLM による後続ワークフロー(検索、エージェント、分析など)への接続をよりスムーズにします。
柔軟なインストールと実行
CUDA 12.6 などの環境に対応した PyTorch と PaddleOCR/PaddleX/Transformers をインストールし、コマンドラインまたは Python API で `--engine transformers` オプションを指定して実行可能です。
Transformers エンジンの設定
PaddleOCR に `engine="transformers"` を指定することで、Transformer ベースのバックエンドを使用して OCR および文書解析タスクを実行できます。
影響分析・編集コメントを表示
影響分析
このアップデートは、OCR ツールが単なる文字認識から文書全体の意味理解へと進化することを示しており、ビジネス文書の自動化処理やデータマイニングの現場において大きな生産性向上をもたらす可能性があります。特に Hugging Face 環境との親和性が高まることで、オープンソースコミュニティにおける OCR モデルの採用基準が再定義される重要な転換点と言えます。
編集コメント
OCR ツールが Transformer ベースへ移行したことは、文書解析の精度向上において決定的なステップであり、実務での適用範囲を大きく広げる画期的なアップデートです。
PaddleOCR 3.5 は、OCR(光学文字認識)およびドキュメント解析タスクを Hugging Face エコシステムに近づけました。今回のリリースにより、engine="transformers"と設定することで、サポート対象の PaddleOCR モデルをHugging Face Transformers を推論バックエンドとして実行可能になりました。
PaddleOCR は引き続き、PP-OCRv5などの OCR モデルシリーズや、PaddleOCR-VL 1.5などのドキュメント解析モデルシリーズを提供し続けており、これらを実行するためのサポート対象バックエンドの一つとして Transformers が加わりました。
Hugging Face Spaces でライブデモを試す:
https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo
何が変わったのか?
PaddleOCR 3.5 は、より柔軟な推論エンジンインターフェースを導入しました。開発者は engine パラメータを通じてバックエンドを選択し、engine_config を介してバックエンド固有のオプションを渡すことができます。
具体的には以下のようになります:
- これらのタスク背後のパイプラインは PaddleOCR によって管理されるため、開発者が各内部コンポーネントを手動で呼び出す必要はありません。
- Transformers は、サポート対象の PaddleOCR モデルを実行するための推論バックエンドの一つとしてサポートされます。
- 開発者は engine_config を通じて、dtype(データ型)、デバイス配置、アテンション実装などのバックエンド関連オプションを構成できます。
スタックを理解する簡単な方法:
Layer
意味
例
アプリケーション層
OCR およびドキュメント解析の出力を利用するアプリケーション
RAG、エージェント、Document AI など...
モデル層
OCR およびドキュメント解析機能
PP-OCRv5、PaddleOCR-VL 1.5 など...
推論バックエンド層
サポート対象モデルを実行するためのランタイム
Paddle static graph(静的グラフ)、Paddle dynamic graph(動的グラフ)、Transformers
今回のリリースは主に推論バックエンド層に関するものです。PaddleOCR は引き続き OCR およびドキュメント解析機能を提供し続ける一方、Transformers により、サポート対象の PaddleOCR モデルが Hugging Face を中心とした環境に自然に適合する新たなバックエンドオプションを得ることになります。より大規模な Document AI のワークフローは依然として開発者やアプリケーションビルダーの手元にあります。
なぜこれが重要なのか
RAG、Document AI、ドキュメントエージェントアプリケーションにおいて、難しい部分は LLM(大規模言語モデル)の前段階から始まることがよくあります。
まず開発者は、PDF、スキャンされた文書、スクリーンショット、表、チャート、数式、複雑なページレイアウトを、信頼性の高い構造化データに変換する必要があります。この取り込みステップが脆弱であれば、下流の LLM ワークフローは重要な情報を見逃したり、誤ったコンテキストを取得したり、信頼性の低い回答を生成したりする可能性があります。
PaddleOCR は、PP-OCRv5 などの OCR シリーズモデルや、PaddleOCR-VL-1.5 などのドキュメント解析シリーズモデルを提供することで、このドキュメント取り込みの課題に対処します。
PaddleOCR 3.5 では、これらの機能が Transformer を中心としたスタックとの接続がより容易になりました。対応する PaddleOCR モデルは Transformers バックエンドで実行可能でありながら、OCR やドキュメント解析パイプラインの管理は引き続き PaddleOCR が裏側で行います。
開発者にとっては、統合における摩擦が減り、ドキュメントから下流の RAG(Retrieval-Augmented Generation)、エージェント、検索、分析、または自動化ワークフローへのより自然な道筋が実現されます。
クイックスタート
PaddleOCR 3.5、PaddleX、Transformers、およびお使いのハードウェアに適合する PyTorch のビルドをインストールしてください。
例えば、CUDA 12.6 環境では以下のようになります:
python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
python -m pip install "paddleocr==3.5.0" "paddlex==3.5.2" "transformers>=5.4.0"
CPU、ROCm、またはその他の環境では、ターゲットハードウェアに一致する PyTorch のビルドをインストールしてください。
コマンドラインから実行します:
paddleocr ocr \
-i https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_002.png \
--device gpu:0 \
--engine transformers
または、Python API を使用します:
from paddleocr import PaddleOCR
pipeline = PaddleOCR(
device="gpu:0",
engine="transformers",
use_doc_orientation_classify=False,
use_doc_unwarping=False,
use_textline_orientation=False,
engine_config={
"dtype": "float32",
},
)
results = pipeline.predict(
"https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_002.png"
)
for result in results:
print(result)
Hugging Face Space では広範な互換性を確保するために float32 を使用しています。ご自身のハードウェアにおいては、engine_config を通じてバックエンド固有のオプションを調整できます:
engine_config = {
"dtype": "bfloat16",
"device_type": "gpu",
"device_id": 0,
"attn_implementation": "sdpa",
}
最適な設定は、モデル、ハードウェア、およびデプロイ環境によって異なります。
Transformers バックエンドを使用すべきタイミングは?
PaddleOCR の OCR(光学文字認識)およびドキュメント解析機能を、Hugging Face を中心としたスタックにより自然に統合したい場合に、Transformers バックエンドを使用してください。
これは特に、RAG(検索拡張生成)、Document AI、検索、分析、またはエージェントアプリケーションを構築中で、モデルの読み込み、実験、デプロイ、あるいはモデルアーティファクト管理のためにすでに PyTorch / Transformers インフラストラクチャに依存している場合に有用です。
Transformers バックエンドは、以下のようなニーズに適しています:
- 既に Transformers を使用しているチームにとってより慣れ親しんだ開発体験,
- サポート対象の PaddleOCR モデルに対する Hub との互換性を持つモデル発見および配布機能,
- 既存の PyTorch / Transformers サービスとの統合が容易になる点。
OCR またはドキュメント解析のスループット最大化が最優先事項である場合、PaddleOCR のデフォルトである paddle_static バックエンド(原語: paddle_static backend)が通常推奨されます。
今回のリリースは、あるバックエンドを別のバックエンドで置き換えるものではありません。開発者に柔軟性を与えるためのものです:OCR およびドキュメント解析機能には PaddleOCR を使用し、ご自身のスタックに最も適した推論用バックエンドを選択してください。
今すぐお試しください
Hugging Face Spaces で PaddleOCR 3.5 の Transformers デモを試すことができます:
https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo
Hub で PaddleOCR モデルを検索する:
https://huggingface.co/PaddlePaddle/models
PaddleOCR 3.5 は、OCR および文書解析の機能を Transformer を中心としたワークフローにより近づけつつも、開発者がその周りに大規模な Document AI アプリケーションを構築する自由を提供します。
リソース
- PaddleOCR ドキュメント: https://www.paddleocr.ai/
- GitHub 上の PaddleOCR: https://github.com/PaddlePaddle/PaddleOCR
- Hugging Face 上の PaddlePaddle オルガニゼーション: https://huggingface.co/PaddlePaddle
- Spaces 上の PaddleOCR 3.5 Transformers デモ: https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo
謝辞
PaddleOCR 3.5 の Transformers 統合をサポートしてくれた Hugging Face のエンジニアの皆様に心から感謝いたします。
エンドツーエンドの関与、関連するすべてのプルリクエストのレビューおよびマージに尽力された Anton Vlasjuk に特に感謝申し上げます。
また、貴重な PR レビューとフィードバックを提供してくれた Raushan Turganbay と Yoni Gozlan にも感謝いたします。
彼らのガイダンスは、Hugging Face コミュニティ向けの統合品質、ドキュメント、開発者体験の向上に貢献しました。
原文を表示
PaddleOCR 3.5 brings OCR and document parsing tasks closer to the Hugging Face ecosystem. With this release, supported PaddleOCR models can run with Hugging Face Transformers as an inference backend by setting:
engine="transformers"
PaddleOCR continues to provide OCR model series such as PP-OCRv5 and document parsing model series such as PaddleOCR-VL 1.5, while Transformers becomes one of the supported backends for running them.
Try the live demo on Hugging Face Spaces:
https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo
What changed?
PaddleOCR 3.5 introduces a more flexible inference-engine interface. Developers can select the backend through the engine parameter and pass backend-specific options through engine_config.
In practice, this means:
- The pipelines behind these tasks are managed by PaddleOCR, so developers do not need to manually call each internal component.
- Transformers becomes one of the supported inference backends for running supported PaddleOCR models.
- Developers can configure backend-related options such as dtype, device placement, and attention implementation through engine_config.
A simple way to understand the stack:
Layer
What it means
Examples
Application layer
Applications that use OCR and document parsing outputs
RAG, agents, Document AI...
Model layer
OCR and document parsing capabilities
PP-OCRv5, PaddleOCR-VL 1.5...
Inference backend layer
Runtime used to run supported models
Paddle static graph, Paddle dynamic graph, Transformers
This release is mainly about the inference backend layer: PaddleOCR continues to provide OCR and document parsing capabilities, while Transformers gives supported PaddleOCR models another backend option that fits naturally into Hugging Face-centered environments. The larger Document AI workflow remains in the hands of developers and application builders.
Why this matters
For RAG, Document AI, and document agent applications, the hard part often starts before the LLM.
Developers first need to turn PDFs, scanned documents, screenshots, tables, charts, formulas, and complex page layouts into reliable structured data. If this ingestion step is weak, the downstream LLM workflow may miss key information, retrieve the wrong context, or produce unreliable answers.
PaddleOCR helps address this document ingestion challenge by providing OCR series models such as PP-OCRv5 and document parsing series models such as PaddleOCR-VL-1.5.
With PaddleOCR 3.5, these capabilities are now easier to connect with Transformers-centered stacks. Supported PaddleOCR models can run with a Transformers backend, while PaddleOCR continues to manage the OCR or document parsing pipeline behind the scenes.
For developers, this means less integration friction and a more natural path from documents to downstream RAG, agent, search, analytics, or automation workflows.
Quick start
Install PaddleOCR 3.5, PaddleX, Transformers, and a compatible PyTorch build for your hardware.
For example, on a CUDA 12.6 environment:
python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
python -m pip install "paddleocr==3.5.0" "paddlex==3.5.2" "transformers>=5.4.0"
For CPU, ROCm, or other environments, install the PyTorch build that matches your target hardware.
Run from the command line:
paddleocr ocr \
-i https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_002.png \
--device gpu:0 \
--engine transformers
Or use the Python API:
from paddleocr import PaddleOCR
pipeline = PaddleOCR(
device="gpu:0",
engine="transformers",
use_doc_orientation_classify=False,
use_doc_unwarping=False,
use_textline_orientation=False,
engine_config={
"dtype": "float32",
},
)
results = pipeline.predict(
"https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_ocr_002.png"
)
for result in results:
print(result)
The Hugging Face Space uses float32 for broad compatibility. For your own hardware, you can tune backend-specific options through engine_config:
engine_config = {
"dtype": "bfloat16",
"device_type": "gpu",
"device_id": 0,
"attn_implementation": "sdpa",
}
The best configuration depends on your model, hardware, and deployment environment.
When should you use the Transformers backend?
Use the Transformers backend when you want PaddleOCR’s OCR and document parsing capabilities to fit more naturally into a Hugging Face-centered stack.
This is especially useful if you are building RAG, Document AI, search, analytics, or agent applications and already rely on PyTorch / Transformers infrastructure for model loading, experimentation, deployment, or model artifact management.
The Transformers backend is a good fit when you want:
- a more familiar development experience for teams already using Transformers,
- Hub-compatible model discovery and distribution for supported PaddleOCR models,
- easier integration with existing PyTorch / Transformers services.
When maximizing OCR or document parsing throughput is the priority, PaddleOCR’s default paddle_static backend is usually the recommended choice.
This release is not about replacing one backend with another. It is about giving developers more flexibility: use PaddleOCR for OCR and document parsing capabilities, and choose the inference backend that best fits your stack.
Try it now
Try the PaddleOCR 3.5 Transformers demo on Hugging Face Spaces:
https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo
Explore PaddleOCR models on the Hub:
https://huggingface.co/PaddlePaddle/models
PaddleOCR 3.5 brings OCR and document parsing capabilities closer to Transformers-centered workflows, while giving developers the freedom to build the larger Document AI applications around them.
Resources
- PaddleOCR documentation: https://www.paddleocr.ai/
- PaddleOCR on GitHub: https://github.com/PaddlePaddle/PaddleOCR
- PaddlePaddle organization on Hugging Face: https://huggingface.co/PaddlePaddle
- PaddleOCR 3.5 Transformers demo on Spaces: https://huggingface.co/spaces/PaddlePaddle/paddleocr-3.5-transformers-demo
Acknowledgements
We sincerely thank the Hugging Face engineers who supported the PaddleOCR 3.5 Transformers integration.
Special thanks to Anton Vlasjuk for his end-to-end involvement, including reviewing and merging all related pull requests.
We also appreciate Raushan Turganbay and Yoni Gozlan for their valuable PR reviews and feedback.
Their guidance helped improve the integration quality, documentation, and developer experience for the Hugging Face community.
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み