Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SWHL committed Mar 5, 2024
1 parent a6a9d02 commit 08b4538
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
25 changes: 21 additions & 4 deletions content/docs/blog/02_config_parameter.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ toc: true
description: ""
---

#### [config.yaml源码](https://github.com/RapidAI/RapidOCR/blob/29d5f5fc01fbff7c49926a3c297fa8a3fb1624af/python/rapidocr_onnxruntime/config.yaml)
#### [config.yaml源码](https://github.com/RapidAI/RapidOCR/blob/main/python/rapidocr_onnxruntime/config.yaml)

<details>
<summary>详情</summary>
Expand All @@ -24,8 +24,16 @@ Global:
min_height: 30
width_height_ratio: 8

use_cuda: &use_cuda false

intra_op_num_threads: &intra_nums -1
inter_op_num_threads: &inter_nums -1

Det:
use_cuda: false
intra_op_num_threads: *intra_nums
inter_op_num_threads: *inter_nums

use_cuda: *use_cuda

model_path: models/ch_PP-OCRv4_det_infer.onnx

Expand All @@ -40,7 +48,10 @@ Det:
score_mode: fast

Cls:
use_cuda: false
intra_op_num_threads: *intra_nums
inter_op_num_threads: *inter_nums

use_cuda: *use_cuda

model_path: models/ch_ppocr_mobile_v2.0_cls_infer.onnx

Expand All @@ -50,7 +61,10 @@ Cls:
label_list: ['0', '180']

Rec:
use_cuda: false
intra_op_num_threads: *intra_nums
inter_op_num_threads: *inter_nums

use_cuda: *use_cuda

model_path: models/ch_PP-OCRv4_rec_infer.onnx

Expand All @@ -69,6 +83,9 @@ Rec:
| `print_verbose` | `bool` | `true` | 是否打印各个部分耗时信息 |
| `min_height` | `int` | 30 | 图像最小高度(单位是像素)<br/>低于这个值,会跳过文本检测阶段,直接进行后续识别 |
|`width_height_ratio`| `int`| 8| 如果输入图像的宽高比大于`width_height_ratio`,则会跳过文本检测,直接进行后续识别<br/>`width_height_ratio=-1`:不用这个参数 |
| `use_cuda` | `bool` | `false` | 是否使用CUDA,加速推理 |
| `intra_op_num_threads` | `int` | -1 | 参见[docs](https://onnxruntime.ai/docs/api/python/api_summary.html#onnxruntime.SessionOptions.inter_op_num_threads) |
| `inter_op_num_threads` | `int` | -1 | 参见[docs](https://onnxruntime.ai/docs/api/python/api_summary.html#onnxruntime.SessionOptions.intra_op_num_threads) |

`min_height`是用来过滤只有一行文本的图像(如下图),这类图像不会进入文本检测模块,直接进入后续过程。

Expand Down
3 changes: 3 additions & 0 deletions content/docs/changelog/rapidocr.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ toc: true
description: ""
---

#### 🎂2024-03-05 v1.3.14 update:
添加可使用的CPU核心数,包括三个推理引擎,onnxruntime/OpenVINO/PaddlePaddle

#### 🔖2024-02-28 v1.3.13 update:
- 优化`LoadImage`类,添加对输入`PIL.Image.Image`的支持
- 修复不同输入类型下,图像通道顺序不同的问题
Expand Down
3 changes: 3 additions & 0 deletions content/docs/changelog/rapidocr_paddle.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ toc: true
description: ""
---

#### 2024-03-05 v1.3.16 update:
`rapidocr_onnxruntime` [Change log](./rapidocr.md#🎂2024-03-05-v1314-update)

#### 2024-02-28 v1.3.15 update:
`rapidocr_onnxruntime` [Change log](./rapidocr.md#🔖2024-02-28-v1313-update)

Expand Down
4 changes: 2 additions & 2 deletions content/docs/install_usage/rapidocr/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ class RapidOCR:
-`config.yaml`方式
1. 找到`rapidocr_onnxruntime`安装目录下的`config.yaml`文件,可以通过`pip show rapidocr_onnxruntime`找到其安装路径。
2.`config.yaml`拷贝出来,放到当前运行目录下
3. 按需自定义参数修改即可,具体参数解释,参见[config.yaml](../../blog/config_parameter.md)
3. 按需自定义参数修改即可,具体参数解释,参见[config.yaml](../../blog/02_config_parameter.md)
```python {linenos=table}
engine = RapidOCR(config_path="your.yaml")
```
- (推荐) 以具体参数传入,参数基本和[config.yaml](../../blog/config_parameter.md)中对应,只是个别名称有所区别。
- (推荐) 以具体参数传入,参数基本和[config.yaml](../../blog/02_config_parameter.md)中对应,只是个别名称有所区别。

{{< alert context="info" text="以下参数均有默认值,可以不传入任何参数,直接初始化使用即可。" />}}
```python {linenos=table}
Expand Down

0 comments on commit 08b4538

Please sign in to comment.