Skip to content

Commit 10fd5f1

Browse files
committed
docs: update blog
1 parent 6552351 commit 10fd5f1

File tree

2 files changed

+64
-20
lines changed

2 files changed

+64
-20
lines changed

docs/install_usage/rapidocr/parameters.md

Lines changed: 63 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ rapidocr config
1818

1919
```yaml linenums="1"
2020
Global:
21-
lang_det: "ch_mobile" # ch_server
22-
lang_rec: "ch_mobile"
2321
text_score: 0.5
2422

2523
use_det: true
@@ -33,18 +31,9 @@ Global:
3331

3432
return_word_box: false
3533

36-
with_onnx: false
37-
with_openvino: false
38-
with_paddle: false
39-
with_torch: false
40-
4134
font_path: null
4235
```
4336
44-
`lang_det (str)`: 文本检测使用模型。默认值是`ch_mobile`,意思是使用中文轻量模型。取值为`[ch_mobile, ch_server]`。
45-
46-
`lang_rec (str)`: 文本识别使用模型。默认值是`ch_mobile`, 意思是使用中文轻量模型。取值为`[ch_mobile, ch_server]`。
47-
4837
`text_score (float)`: 文本识别结果置信度,值越大,把握越大。取值范围:`[0, 1]`, 默认值是0.5。
4938

5039
`use_det (bool)`: 是否使用文本检测。默认为`True`。
@@ -70,14 +59,6 @@ Global:
7059
- 在`rapidocr_onnxruntime>=1.4.1`中,汉字返回单字坐标,英语返回单字母坐标。
7160
- 在`rapidocr_onnxruntime==1.4.0`中,汉字会返回单字坐标,英语返回单词坐标。
7261

73-
`with_onnx (bool)`: 是否使用[ONNXRuntime](https://github.com/microsoft/onnxruntime)推理引擎。默认为`False`。注意:在所有推理引擎都为`False`时,会默认采用ONNXRuntime。
74-
75-
`with_openvino (bool)`: 是否使用[OpenVINO](https://github.com/openvinotoolkit/openvino)推理引擎,默认为`False`。
76-
77-
`with_paddle (bool)`: 是否使用[PaddlePaddle](https://www.paddlepaddle.org.cn/install/quick)推理引擎,默认为`False`。
78-
79-
`with_torch (bool)`: 是否使用[PyTorch](https://pytorch.org/)推理引擎,默认为`False`。
80-
8162
`font_path (str)`: 字体文件路径。如不提供,程序会自动下载预置的字体文件模型到本地。默认为`null`。
8263

8364
#### EngineConfig
@@ -89,6 +70,7 @@ EngineConfig:
8970
onnxruntime:
9071
intra_op_num_threads: -1
9172
inter_op_num_threads: -1
73+
enable_cpu_mem_arena: false
9274
use_cuda: false
9375
use_dml: false
9476
@@ -118,6 +100,13 @@ PyTorch API 参见:[PyTorch documentation](https://pytorch.org/docs/stable/ind
118100

119101
```yaml linenums="1"
120102
Det:
103+
engine_type: 'onnxruntime'
104+
lang_type: 'ch'
105+
model_type: 'mobile'
106+
ocr_version: 'PP-OCRv4'
107+
108+
task_type: 'det'
109+
121110
model_path: null
122111
model_dir: null
123112
@@ -134,6 +123,14 @@ Det:
134123
score_mode: fast
135124
```
136125

126+
`engine_type (str)`: 选定推理引擎。支持`onnxruntime`、`openvino`、`paddle`和`torch`四个值。默认为`onnxruntime`。
127+
128+
`lang_type (str)`: 支持检测的语种类型。这里指的是`LangDet`,具体支持`ch`、`en`和`multi`3个值。`ch`可以识别中文和中英文混合文本检测。`en`支持英文文字检测。`multi`支持多语言文本检测。默认为`ch`。
129+
130+
`model_type (str)`: 模型量级选择,支持`mobile`(轻量型)和`server`(服务型)。默认为`mobile`。
131+
132+
`ocr_version (str)`: ocr版本的选择,支持`PP-OCRv4`和`PP-OCRv5`,默认为`PP-OCRv4`。
133+
137134
`model_path (str)`: 文本检测模型路径,仅限于基于PaddleOCR训练所得DBNet文本检测模型。默认值为`null`。
138135

139136
`limit_side_len (float)`: 限制图像边的长度的像素值。默认值为736。
@@ -156,6 +153,13 @@ Det:
156153

157154
```yaml linenums="1"
158155
Cls:
156+
engine_type: 'onnxruntime'
157+
lang_type: 'ch'
158+
model_type: 'mobile'
159+
ocr_version: 'PP-OCRv4'
160+
161+
task_type: 'cls'
162+
159163
model_path: null
160164
model_dir: null
161165
@@ -165,6 +169,14 @@ Cls:
165169
label_list: ['0', '180']
166170
```
167171

172+
`engine_type (str)`: 同Det部分介绍。
173+
174+
`lang_type (str)`: 支持检测的语种类型。这里指的是`LangCls`,目前只有一种选项:`ch`。默认为`ch`。
175+
176+
`model_type (str)`: 同Det部分介绍。
177+
178+
`ocr_version (str)`: 同Det部分介绍。
179+
168180
`model_path (str)`: 文本行方向分类模型路径,仅限于PaddleOCR训练所得二分类分类模型。默认值为`None`。
169181

170182
`model_dir (str)`: 占位参数,暂时无效。
@@ -181,6 +193,13 @@ Cls:
181193

182194
```yaml linenums="1"
183195
Rec:
196+
engine_type: 'onnxruntime'
197+
lang_type: 'ch'
198+
model_type: 'mobile'
199+
ocr_version: 'PP-OCRv4'
200+
201+
task_type: 'rec'
202+
184203
model_path: null
185204
model_dir: null
186205
@@ -189,6 +208,31 @@ Rec:
189208
rec_batch_num: 6
190209
```
191210

211+
`engine_type (str)`: 同Det部分介绍。
212+
213+
`lang_type (str)`: 支持检测的语种类型。这里指的是`LangRec`,目前支持以下几种:
214+
215+
```python linenums="1"
216+
class LangRec(Enum):
217+
CH = "ch"
218+
CH_DOC = "ch_doc"
219+
EN = "en"
220+
ARABIC = "arabic"
221+
CHINESE_CHT = "chinese_cht"
222+
CYRILLIC = "cyrillic"
223+
DEVANAGARI = "devanagari"
224+
JAPAN = "japan"
225+
KOREAN = "korean"
226+
KA = "ka"
227+
LATIN = "latin"
228+
TA = "ta"
229+
TE = "te"
230+
```
231+
232+
`model_type (str)`: 同Det部分介绍。
233+
234+
`ocr_version (str)`: 同Det部分介绍。
235+
192236
`model_path (str)`: 文本识别模型路径,仅限于PaddleOCR训练文本识别模型。默认值为`None`。
193237

194238
`model_dir (str)`: 模型存放路径或目录。如果是PaddlePaddle,该参数则对应模型存在目录。其余推理引擎对应模型地址。

docs/install_usage/rapidocr/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ result.vis("vis_result.jpg")
3838

3939
=== "方法一:传入配置文件"
4040

41-
1. 生成**default_rapidocr.yaml**的配置文件。终端执行以下代码,即可在当前目录下生成默认的**default_rapidocr.yaml**文件。
41+
1. 生成 **default_rapidocr.yaml** 的配置文件。终端执行以下代码,即可在当前目录下生成默认的 **default_rapidocr.yaml** 文件。
4242

4343
```bash linenums="1"
4444
$ rapidocr config

0 commit comments

Comments
 (0)