docling-project / docling-project/docling
[Feature] Allow model size configuration for RapidOCR
- Dominant language
- Python
- Stars
- 66.4k
- Forks
- 4.8k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 84
Description
### Requested feature
PP-OCRv6 has `tiny` and `medium` model sizes, which are [supported by RapidOCR](https://www.modelscope.cn/models/RapidAI/RapidOCR/tree/master/onnx/PP-OCRv6/det), but Docling currently [hardcodes model size `small`](https://github.com/docling-project/docling/blob/v2.120.2/docling/models/stages/ocr/rapid_ocr_model.py#L34). An option to change that setting would be great.
From my profilings on a CPU-only scenario, OCR is the slowest stage by far, even on PDF files with native text mostly avaliable. Maybe the `tiny` model could help improve this.
Contributor guide
Research direction
Start in docling/models/stages/ocr/rapid_ocr_model.py, where the PP-OCRv6 model size is hardcoded to small, and trace how RapidOCR model settings are configured. Add a user-selectable size supporting the tiny and medium models documented in the issue, then verify OCR can use each supported size.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 74/100