RapidAI / RapidAI/RapidDoc

为什么启用了ocr_config的OCRModelType.MEDIUM, 还是运行PP-OCRv6_rec_small

Open Beginner friendly
#52 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
230
Forks
41
PR merge metrics
No merged PRs in 30d

Description

为什么启用了ocr_config的OCRModelType.MEDIUM, 还是运行PP-OCRv6_rec_small

代码是:
from rapidocr import EngineType as OCREngineType, OCRVersion, ModelType as OCRModelType
ocr_config = {
"Det.engine_type": OCREngineType.ONNXRUNTIME,
"Det.model_type": OCRModelType.MEDIUM,
"Det.ocr_version": OCRVersion.PPOCRV6,
"Rec.engine_type": OCREngineType.ONNXRUNTIME,
"Rec.model_type": OCRModelType.MEDIUM,
"Rec.ocr_version": OCRVersion.PPOCRV6,
}

image_config = {
"extract_original_image": True,
}
layout_config = {
"markdown_ignore_labels": []
}
table_config = {
"skip_text_in_image": False,
"use_compare_table": True, # 启用表格结果比较(同时跑有线/无线并比对),默认 False
"table_image_enable": True, # 表格内图片识别
"extract_original_image": True # 是否提取表格内原始图片,默认 False
}

engine = RapidDoc(table_config=table_config, image_config=image_config, layout_config=layout_config,
ocr_config=ocr_config)

ocr_config已经设置了OCRModelType.MEDIUM, 但是日志里没有显示medium的相关内容:

[INFO] 2026-08-12 11:01:26,716 [RapidOCR] base.py:23: Using engine_name: onnxruntime
[INFO] 2026-08-12 11:01:26,718 [RapidOCR] main.py:63: Using D:\ProgramData\PyCharmProject\test-python\venv\lib\site-packages\rapid_doc\resources\PP-OCRv6_det_small.onnx
[INFO] 2026-08-12 11:01:26,765 [RapidOCR] base.py:23: Using engine_name: onnxruntime
[INFO] 2026-08-12 11:01:26,768 [RapidOCR] download_file.py:60: File exists and is valid: D:\ProgramData\PyCharmProject\test-python\venv\Lib\site-packages\rapidocr\models\ch_ppocr_mobile_v2.0_cls_mobile.onnx
[INFO] 2026-08-12 11:01:26,768 [RapidOCR] main.py:63: Using D:\ProgramData\PyCharmProject\test-python\venv\Lib\site-packages\rapidocr\models\ch_ppocr_mobile_v2.0_cls_mobile.onnx
[INFO] 2026-08-12 11:01:26,857 [RapidOCR] base.py:23: Using engine_name: onnxruntime
[INFO] 2026-08-12 11:01:26,858 [RapidOCR] main.py:63: Using D:\ProgramData\PyCharmProject\test-python\venv\lib\site-packages\rapid_doc\resources\PP-OCRv6_rec_small.onnx
[INFO] 2026-08-12 11:01:28,308 [RapidOCR] base.py:23: Using engine_name: onnxruntime
[INFO] 2026-08-12 11:01:28,309 [RapidOCR] main.py:63: Using D:\ProgramData\PyCharmProject\test-python\venv\lib\site-packages\rapid_doc\resources\PP-OCRv6_det_small.onnx
[INFO] 2026-08-12 11:01:29,149 [RapidOCR] base.py:23: Using engine_name: onnxruntime
[INFO] 2026-08-12 11:01:29,152 [RapidOCR] download_file.py:60: File exists and is valid: D:\ProgramData\PyCharmProject\test-python\venv\Lib\site-packages\rapidocr\models\ch_ppocr_mobile_v2.0_cls_mobile.onnx
[INFO] 2026-08-12 11:01:29,153 [RapidOCR] main.py:63: Using D:\ProgramData\PyCharmProject\test-python\venv\Lib\site-packages\rapidocr\models\ch_ppocr_mobile_v2.0_cls_mobile.onnx
[INFO] 2026-08-12 11:01:29,831 [RapidOCR] base.py:23: Using engine_name: onnxruntime
[INFO] 2026-08-12 11:01:29,832 [RapidOCR] main.py:63: Using D:\ProgramData\PyCharmProject\test-python\venv\lib\site-packages\rapid_doc\resources\PP-OCRv6_rec_small.onnx

[INFO] 2026-08-12 11:02:03,266 [RapidOCR] base.py:23: Using engine_name: openvino
[INFO] 2026-08-12 11:02:03,268 [RapidOCR] main.py:56: Using D:\ProgramData\PyCharmProject\test-python\venv\lib\site-packages\rapid_doc\resources\pp-ocrv4_mobile_seal_det.onnx
[INFO] 2026-08-12 11:02:03,269 [RapidOCR] device_config.py:50: Using OpenVINO config: {}
[INFO] 2026-08-12 11:02:03,483 [RapidOCR] base.py:23: Using engine_name: onnxruntime
[INFO] 2026-08-12 11:02:03,484 [RapidOCR] download_file.py:60: File exists and is valid: D:\ProgramData\PyCharmProject\test-python\venv\Lib\site-packages\rapidocr\models\ch_ppocr_mobile_v2.0_cls_mobile.onnx
[INFO] 2026-08-12 11:02:03,484 [RapidOCR] main.py:63: Using D:\ProgramData\PyCharmProject\test-python\venv\Lib\site-packages\rapidocr\models\ch_ppocr_mobile_v2.0_cls_mobile.onnx
[INFO] 2026-08-12 11:02:03,519 [RapidOCR] base.py:23: Using engine_name: openvino
[INFO] 2026-08-12 11:02:03,519 [RapidOCR] main.py:56: Using D:\ProgramData\PyCharmProject\test-python\venv\lib\site-packages\rapid_doc\resources\PP-OCRv6_rec_small.onnx
[INFO] 2026-08-12 11:02:03,520 [RapidOCR] device_config.py:50: Using OpenVINO config: {}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the OCR initialization entries shown in main.py and base.py, then follow how the supplied Det.model_type and Rec.model_type values are handled. Compare that selection with the PP-OCRv6_rec_small paths in the logs; done means OCRModelType.MEDIUM selects and reports the expected medium model for both detection and recognition.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.