Skip to content

v0.4.0

Choose a tag to compare

@yz3440 yz3440 released this 12 Feb 20:31
· 4 commits to main since this release

PaddleOCR Engine Update for v3.x Compatibility

This release updates the PaddleOCR engine to work with PaddleOCR 3.x (the current version available on PyPI). The PaddleOCR library underwent a major API overhaul between v2 and v3, making the previous engine code non-functional with current installations.

Breaking Changes

  • PaddleOCR minimum version: Now requires paddleocr>=3.0.0 and paddlepaddle>=3.0.0
  • use_v4_server config deprecated: Use ocr_version="PP-OCRv4" instead. Model management is now handled automatically by PaddleOCR.
  • use_gpu config deprecated: GPU/CPU device selection is now automatic in PaddleOCR 3.x.
  • Engine name: All PaddleOCR results now use "PADDLE_OCR" as the engine name (previously V4 server results used "PADDLE_OCR_SERVER_V4").

New Features

  • PaddleOCRVersion enum: Choose between PP-OCRv3, PP-OCRv4, or PP-OCRv5 model versions.
  • PP-OCRv5 by default: PaddleOCR now auto-selects the latest PP-OCRv5 models for most languages.
  • Custom model overrides: Pass text_detection_model_name, text_recognition_model_name, text_det_limit_side_len, or text_rec_score_thresh in config.
  • Automatic model downloads: Models are automatically downloaded from HuggingFace and cached locally.
  • PaddlePaddle dependency check: Clear error message if paddlepaddle is not installed.

Fixes

  • Replaced deprecated ocr() call with predict() API
  • Replaced use_angle_cls with use_textline_orientation
  • Updated result parsing for new OCRResult format (rec_texts, rec_scores, dt_polys)
  • Disabled unnecessary document preprocessing (orientation classify, unwarping) for perspective image crops
  • Suppressed PaddleOCR connectivity check by default for faster initialization

Installation

pip install "panoocr[paddleocr]"

This now automatically installs both paddleocr and paddlepaddle.

Migration Guide

# Before (v0.3.x)
engine = PaddleOCREngine(config={
    "language_preference": PaddleOCRLanguageCode.CHINESE,
    "use_v4_server": True,
    "use_gpu": True,
})

# After (v0.4.0)
engine = PaddleOCREngine(config={
    "language_preference": PaddleOCRLanguageCode.CHINESE,
    "ocr_version": "PP-OCRv4",  # or PaddleOCRVersion.PP_OCRV4
})