Skip to content

Commit 6d3e25a

Browse files
committed
docs: update docs
1 parent 286d475 commit 6d3e25a

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed

docs/install_usage/rapidocr/parameters.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,58 @@ EngineConfig:
120120
gpu_id: 0
121121
```
122122

123+
=== "ONNXRuntime DirectML使用"
124+
125+
!!! tip
126+
127+
DirectML仅能Windows 10 Build 18362及以上使用
128+
129+
1. 安装
130+
131+
```bash linenums="1"
132+
pip install rapidocr onnxruntime-directml
133+
```
134+
135+
2. 使用
136+
137+
```python linenums="1"
138+
from rapidocr import RapidOCR
139+
140+
engine = RapidOCR(params={"EngineConfig.onnxruntime.use_dml": True})
141+
142+
img_url = "<https://img1.baidu.com/it/u=3619974146,1266987475&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=516>"
143+
result = engine(img_url)
144+
print(result)
145+
146+
result.vis("vis_result.jpg")
147+
```
148+
149+
=== "ONNXRuntime NPU使用"
150+
151+
!!! tip
152+
153+
ONNXRuntime中相关文档参考:[link](https://onnxruntime.ai/docs/execution-providers/community-maintained/CANN-ExecutionProvider.html)
154+
155+
1. 安装
156+
157+
```bash linenums="1"
158+
pip install rapidocr onnxruntime-cann
159+
```
160+
161+
2. 使用
162+
163+
```python linenums="1"
164+
from rapidocr import RapidOCR
165+
166+
engine = RapidOCR(params={"EngineConfig.onnxruntime.use_cann": True})
167+
168+
img_url = "<https://img1.baidu.com/it/u=3619974146,1266987475&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=516>"
169+
result = engine(img_url)
170+
print(result)
171+
172+
result.vis("vis_result.jpg")
173+
```
174+
123175
ONNXRuntime Python API 参见:[Python API](https://onnxruntime.ai/docs/api/python/api_summary.html)
124176

125177
OpenVINO Python API 参见:[OpenVINO Python API](https://docs.openvino.ai/2025/api/ie_python_api/api.html)

docs/install_usage/rapidocr/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ RapidOCR输出包括4种类型:`Union[TextDetOutput, TextClsOutput, TextRecOut
802802
from rapidocr import RapidOCR
803803

804804
engine = RapidOCR(
805-
params={"Det.model_path": "rapidocr/models/ch_PP-OCRv4_det_infer.onnx"}
805+
params={"Det.model_path": "models/ch_PP-OCRv4_det_infer.onnx"}
806806
)
807807

808808
img_url = "https://img1.baidu.com/it/u=3619974146,1266987475&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=516"

0 commit comments

Comments
 (0)