AI·News
뒤로

PaddleOCR 3.5: Transformers 백엔드를 이용한 OCR 및 문서 파싱 작업

PaddleOCR 3.5: Running OCR and Document Parsing Tasks with a Transformers Backend

PaddleOCR 3.5: Transformers 백엔드로 OCR 및 문서 파싱 작업 실행하기

PaddleOCR 3.5는 OCR 및 문서 파싱 작업을 Hugging Face 생태계에 더 가깝게 가져옵니다. 이번 릴리스에서는 다음과 같이 설정하여 지원되는 PaddleOCR 모델을

Hugging Face Transformers를 추론 백엔드로 실행

할 수 있습니다:

engine="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, 장치 배치, 어텐션 구현과 같은 백엔드 관련 옵션을 구성할 수 있습니다.

스택을 이해하는 간단한 방법:

레이어 의미 예시
애플리케이션 레이어 OCR 및 문서 파싱 출력을 사용하는 애플리케이션 RAG, agents, 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로 이제 이러한 기능을 Transformers 중심 스택에 더 쉽게 연결할 수 있습니다. 지원되는 PaddleOCR 모델은 Transformers 백엔드로 실행할 수 있으며, PaddleOCR은 계속해서 백그라운드에서 OCR 또는 문서 파싱 파이프라인을 관리합니다.

개발자의 경우 이는 통합 마찰이 적고 문서에서 다운스트림 RAG, 에이전트, 검색, 분석 또는 자동화 워크플로우로의 더 자연스러운 경로를 의미합니다.

빠른 시작

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 백엔드가 일반적으로 권장됩니다.

이번 릴리스는 한 백엔드를 다른 백엔드로 교체하는 것이 아닙니다. 개발자에게 더 많은 유연성을 제공하는 것입니다: 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 및 문서 파싱 기능을 Transformers 중심 워크플로우에 더 가깝게 가져오며, 개발자에게 이를 중심으로 더 큰 Document AI 애플리케이션을 구축할 자유를 제공합니다.

리소스

감사의 말씀

PaddleOCR 3.5 Transformers 통합을 지원해주신 Hugging Face 엔지니어들께 진심으로 감사드립니다.

관련 모든 풀 요청을 검토하고 병합하는 것을 포함하여 끝에서 끝까지 관여해주신 Anton Vlasjuk께 특별히 감사드립니다.

귀중한 PR 검토 및 피드백을 주신 Raushan TurganbayYoni Gozlan에게도 감사드립니다.

그들의 지도는 Hugging Face 커뮤니티를 위한 통합 품질, 문서 및 개발자 경험을 개선하는 데 도움이 되었습니다.

PaddleOCR 3.5: Running OCR and Document Parsing Tasks with a Transformers Backend

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

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.

원문 보기 https://huggingface.co/blog/PaddlePaddle/paddleocr-transformers