From c3b6589f52898014ffe0e862bafe0c7d3898efa1 Mon Sep 17 00:00:00 2001 From: ZhangAo Date: Thu, 26 Mar 2026 17:26:47 +0800 Subject: [PATCH] u --- code/OCR.yaml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 code/OCR.yaml diff --git a/code/OCR.yaml b/code/OCR.yaml new file mode 100644 index 00000000..697b3dc2 --- /dev/null +++ b/code/OCR.yaml @@ -0,0 +1,38 @@ +# 整体 pipeline 名称,用于识别产线名称 +pipeline_name: OCR + +# 文本类型,可选 general(通用)或 others,决定一些后处理策略 +text_type: general + +# 如无严重倾斜/扫描件,建议设为 False,可显著提升速度 +use_doc_preprocessor: False + +# mobile 模型一般建议关闭 +use_textline_orientation: False + +# 正式的 OCR 主流程模块 +SubModules: + + # 文本检测模块(通常是基于 DB 的检测器) + TextDetection: + module_name: text_detection + model_name: PP-OCRv5_mobile_det # 使用的是 mobile 版大模型 + model_dir: ./det_inference # 本地模型文件夹路径(需包含 model.pdmodel 等) + # 调大输入尺寸,关注细节 + limit_side_len: 960 + limit_type: min + max_side_limit: 4000 + # 降低阈值,减少漏检 + thresh: 0.3 + box_thresh: 0.5 + # 放宽文本框,避免裁字 + unclip_ratio: 1.8 + + # 文本识别模块(通常是 CRNN + CTC 或 SVTR 模型) + TextRecognition: + module_name: text_recognition + model_name: PP-OCRv5_mobile_rec # 同样使用的是 mobile 版识别模型 + model_dir: ./rec_inference + batch_size: 6 # 一次识别图块的数量,适当调大可提高 GPU 利用率 + score_thresh: 0.0 # 识别结果置信度下限,低于此不输出 +