#18347·PaddleOCR

识别不准确

Author: xiaoxinmiaoCreated Sep 5, 2026Updated Sep 8, 2026

Search before asking

  • I have searched the PaddleOCR Docs and found no similar bug report.
  • I have searched the PaddleOCR Issues and found no similar bug report.
  • I have searched the PaddleOCR Discussions and found no similar bug report.

Bug (问题描述)

文档中 全部账单,转账-转给登封市场小杨,当前状态,对方已收钱 被识别成 识别内容: 全制单 (置信度: 1.00) 识别内容: 全房路学市市 (置信度: 1.00) 识别内容: 宇别家 (置信度: 1.00) 识别内容: 号房 (置信度: 1.00)

‍♂️ Environment (运行环境)

windows python 3.13 CPU paddleocr 3.7.0 paddlepaddle 3.3.0

Minimal Reproducible Example (最小可复现问题的Demo)

import os

os.environ.setdefault('HUB_DATASET_ENDPOINT', 'https://modelscope.cn')
os.environ["PADDLE_PDX_ENABLE_MKLDNN_BYDEFAULT"] = "0"
os.environ["FLAGS_use_onednn"] = "0"
os.environ["FLAGS_enable_pir_api"] = "0"

from paddleocr import PaddleOCR

def start_ocr(image_path):
    ocr = PaddleOCR(use_textline_orientation=True, lang='ch', device='cpu')
    result = ocr.predict(image_path)
    
    if result:
        for res in result:
            json_data = getattr(res, 'json', None)
            if json_data and isinstance(json_data, dict):
                data_dict = json_data.get('res')
                if data_dict and 'rec_texts' in data_dict:
                    texts = data_dict['rec_texts']
                    scores = list(data_dict['rec_scores']) if 'rec_scores' in data_dict else []
                    
                    for i, text in enumerate(texts):
                        text_clean = str(text).strip()
                        if text_clean:
                            score = scores[i] if i < len(scores) else 1.0
                            print(f"识别内容: {text_clean}  (置信度: {float(score):.2f})")

if __name__ == "__main__":
    test_image = "test/8.10_10.jpg" 
    if os.path.exists(test_image):
        start_ocr(test_image)