Skip to content

Commit

Permalink
docs: update return_word_box
Browse files Browse the repository at this point in the history
  • Loading branch information
SWHL committed Nov 19, 2024
1 parent 0f44412 commit a086ecc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion docs/install_usage/api/RapidOCR.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def __init__(self, text_score: float = 0.5,
width_height_ratio: float = 8,
max_side_len: int = 2000,
min_side_len: int = 30,
return_word_box: bool = False,
det_use_cuda: bool = False,
det_use_dml: bool = False,
det_model_path: Optional[str] = None,
Expand Down Expand Up @@ -198,6 +199,7 @@ RapidOCR在调用时,有三个参数`use_det | use_cls | use_rec`,可以控
如果图像中未检测到有效文字信息,则返回`Tuple[None, None]`。详细搭配如下:

=== "返回单字坐标"

⚠️注意:汉字是单字坐标,英语是单词坐标

```python linenuns="1"
Expand All @@ -212,6 +214,7 @@ RapidOCR在调用时,有三个参数`use_det | use_cls | use_rec`,可以控
```

返回值`result`: `List[List[float], str, float, List, List[str]]` (`[[左上, 右上, 右下, 左下], 文本内容, 置信度, 单字坐标, 对应的单字文本]`)

```python linenums="1"
[
[
Expand All @@ -231,12 +234,18 @@ RapidOCR在调用时,有三个参数`use_det | use_cls | use_rec`,可以控
'大桶装更划算',
0.9843036532402039,
[
[[70, 98], [99, 98], [99, 125], [70, 125]], [[99, 98], [129, 98], [129, 125], [99, 125]], [[129, 98], [160, 98], [160, 125], [129, 125]], [[165, 98], [194, 98], [194, 125], [165, 125]], [[194, 98], [224, 98], [224, 125], [194, 125]], [[224, 98], [252, 98], [252, 125], [224, 125]]
[[70, 98], [99, 98], [99, 125], [70, 125]],
[[99, 98], [129, 98], [129, 125], [99, 125]],
[[129, 98], [160, 98], [160, 125], [129, 125]],
[[165, 98], [194, 98], [194, 125], [165, 125]],
[[194, 98], [224, 98], [224, 125], [194, 125]],
[[224, 98], [252, 98], [252, 125], [224, 125]]
],
['大', '桶', '装', '更', '划', '算']
],
...
]
```

=== "只有检测"

Expand Down

0 comments on commit a086ecc

Please sign in to comment.