Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SWHL committed May 15, 2024
1 parent 6278ec9 commit 2d47a2b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
16 changes: 9 additions & 7 deletions content/docs/blog/02_config_parameter.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@ 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:
intra_op_num_threads: *intra_nums
inter_op_num_threads: *inter_nums

use_cuda: *use_cuda
use_cuda: false
use_dml: false

model_path: models/ch_PP-OCRv4_det_infer.onnx

Expand All @@ -53,7 +52,8 @@ Cls:
intra_op_num_threads: *intra_nums
inter_op_num_threads: *inter_nums

use_cuda: *use_cuda
use_cuda: false
use_dml: false

model_path: models/ch_ppocr_mobile_v2.0_cls_infer.onnx

Expand All @@ -66,12 +66,14 @@ Rec:
intra_op_num_threads: *intra_nums
inter_op_num_threads: *inter_nums

use_cuda: *use_cuda
use_cuda: false
use_dml: false

model_path: models/ch_PP-OCRv4_rec_infer.onnx

rec_img_shape: [3, 48, 320]
rec_batch_num: 6

```

</details>
Expand All @@ -85,7 +87,6 @@ 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) |

Expand All @@ -98,7 +99,8 @@ Rec:

| 参数名称 | 取值范围 | 默认值 | 作用 |
| :------------ | :----------: | :-----: | :----------------------------------------------|
| `use_cuda` | `bool` | `false` | 是否使用CUDA,加速推理 |
| `use_cuda` | `bool` | `false` | 是否使用CUDA加速推理 |
| `use_dml` | `bool` | `false` | 是否使用DirectML加速推理(仅限于Window10及以上) |
|`limit_side_len`| - | 736 | 限制图像边的长度的像素值 |
|`limit_type`| `[min, max]` | `min` | 限制图像的最小边长度还是最大边为`limit_side_len` <br/> 示例解释:当`limit_type=min``limit_side_len=736`时,图像最小边小于736时,<br/>会将图像最小边拉伸到736,另一边则按图像原始比例等比缩放。 |
| `thresh` | `[0, 1]` | 0.3 | 图像中文字部分和背景部分分割阈值<br/>值越大,文字部分会越小 |
Expand Down
4 changes: 4 additions & 0 deletions content/docs/changelog/rapidocr.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ toc: true
description: ""
---

#### 🛠️2024-05-15 v1.3.19 update:
- 因为DirectML受支持设备限制,因此将DirectML作为一个选项写入配置文件,选择性调用
- 在Windows平台仍然恢复到v1.3.18前,默认安装`onnxruntime`库。如DirectML可用,且显式指定时,需要手动安装。
- 相关讨论:[PR #178]() [Discussion #175](https://github.com/RapidAI/RapidOCR/discussions/175)

#### 🧚🏻‍♀️2024-05-12 v1.3.18 update:
- Merge [PR #176](https://github.com/RapidAI/RapidOCR/pull/176)
Expand Down
3 changes: 3 additions & 0 deletions content/docs/install_usage/rapidocr/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class RapidOCR:
min_height: int = 30,
width_height_ratio: float = 8,
det_use_cuda: bool = False,
det_use_dml: bool = False,
det_model_path: Optional[str] = None,
det_limit_side_len: float = 736,
det_limit_type: str = "min",
Expand All @@ -45,12 +46,14 @@ class RapidOCR:
det_donot_use_dilation: bool = False,
det_score_mode: str = "fast",
cls_use_cuda: bool = False,
cls_use_dml: bool = False,
cls_model_path: Optional[str] = None,
cls_image_shape: List[int] = [3, 48, 192],
cls_label_list: List[str] = ["0", "180"],
cls_batch_num: int = 6,
cls_thresh: float = 0.9,
rec_use_cuda: bool = False,
rec_use_dml bool = False,
rec_model_path: Optional[str] = None,
rec_img_shape: List[int] = [3, 48, 320],
rec_batch_num: int = 6,
Expand Down

0 comments on commit 2d47a2b

Please sign in to comment.