Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SWHL committed Sep 21, 2023
1 parent d8fc19e commit cfda91f
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 56 deletions.
31 changes: 31 additions & 0 deletions content/docs/communicate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
weight: 90
title: "交流群"
description: ""
icon: article
date: 2022-11-22T12:36:15+00:00
lastmod: 2022-11-22T12:36:15+00:00
draft: false
images: []
---

可通过以下方式与RapidOCR维护者[SWHL](https://github.com/SWHL)进行沟通,也欢迎反馈使用过程中遇到的问题。

### 知识星球RapidAI私享群
这里的提问会优先得到回答和支持,也会享受到RapidAI组织后续持续优质的服务,欢迎大家的加入。

<div align="center">
<img src="https://raw.githubusercontent.com/RapidAI/.github/main/assets/KnowledgePlanet.jpg" width="25%" height="25%">
</div>

### 微信交流群
微信扫描以下二维码,关注RapidAI公众号,回复OCR即可加入RapidOCR微信交流群:
<div align="center">
<img src="https://raw.githubusercontent.com/RapidAI/.github/main/assets/RapidAI_WeChatAccount.jpg" width="25%" height="25%" align="center">
</div>

### QQ交流群
欢迎加入我们的QQ群下载模型及测试程序。1群:~887298230~ 已满,2群:~755960114~ 已满,3群:450338158
<div align="center">
<img src="https://github.com/RapidAI/RapidOCR/releases/download/v1.1.0/QQ3.jpg" width="25%" height="25%" align="center">
</div>
108 changes: 62 additions & 46 deletions content/docs/install_usage/rapidocr/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,56 +12,36 @@ tags:
categories:
---

<p>
<a href=""><img src="https://img.shields.io/badge/Python->=3.6,<3.12-aff.svg"></a>
<a href=""><img src="https://img.shields.io/badge/OS-Linux%2C%20Win%2C%20Mac-pink.svg"></a>
<a href="https://pypi.org/project/rapidocr-onnxruntime/"><img alt="PyPI" src="https://img.shields.io/pypi/v/rapidocr-onnxruntime?style=flat-square"></a>
<a href="https://pepy.tech/project/rapidocr_onnxruntime"><img src="https://static.pepy.tech/personalized-badge/rapidocr_onnxruntime?period=total&units=abbreviation&left_color=grey&right_color=blue&left_text=Downloads%20Ort"></a>
</p>

`rapidocr_onnxruntime`包含了命令行工具,安装之后,即可使用。

### 参数说明
```bash {linenos=table}
$ rapidocr_onnxruntime -h
usage: rapidocr_onnxruntime
[-h]
-img
IMG_PATH
[-p]
[--text_score TEXT_SCORE]
[--no_det]
[--no_cls]
[--no_rec]
[--print_verbose]
[--min_height MIN_HEIGHT]
[--width_height_ratio WIDTH_HEIGHT_RATIO]
[--det_use_cuda]
[--det_model_path DET_MODEL_PATH]
[--det_limit_side_len DET_LIMIT_SIDE_LEN]
[--det_limit_type {max,min}]
[--det_thresh DET_THRESH]
[--det_box_thresh DET_BOX_THRESH]
[--det_unclip_ratio DET_UNCLIP_RATIO]
[--det_donot_use_dilation]
[--det_score_mode {slow,fast}]
[--cls_use_cuda]
[--cls_model_path CLS_MODEL_PATH]
[--cls_image_shape CLS_IMAGE_SHAPE]
[--cls_label_list CLS_LABEL_LIST]
[--cls_batch_num CLS_BATCH_NUM]
[--cls_thresh CLS_THRESH]
[--rec_use_cuda]
[--rec_model_path REC_MODEL_PATH]
[--rec_img_shape REC_IMG_SHAPE]
[--rec_batch_num REC_BATCH_NUM]

options:
-h, --help
show this
help
message and
exit
usage: rapidocr_onnxruntime [-h] -img IMG_PATH [-p] [--text_score TEXT_SCORE]
[--no_det] [--no_cls] [--no_rec] [--print_verbose]
[--min_height MIN_HEIGHT]
[--width_height_ratio WIDTH_HEIGHT_RATIO]
[--det_use_cuda] [--det_model_path DET_MODEL_PATH]
[--det_limit_side_len DET_LIMIT_SIDE_LEN]
[--det_limit_type {max,min}]
[--det_thresh DET_THRESH]
[--det_box_thresh DET_BOX_THRESH]
[--det_unclip_ratio DET_UNCLIP_RATIO]
[--det_donot_use_dilation]
[--det_score_mode {slow,fast}] [--cls_use_cuda]
[--cls_model_path CLS_MODEL_PATH]
[--cls_image_shape CLS_IMAGE_SHAPE]
[--cls_label_list CLS_LABEL_LIST]
[--cls_batch_num CLS_BATCH_NUM]
[--cls_thresh CLS_THRESH] [--rec_use_cuda]
[--rec_model_path REC_MODEL_PATH]
[--rec_img_shape REC_IMG_SHAPE]
[--rec_batch_num REC_BATCH_NUM] [-vis]
[--vis_font_path VIS_FONT_PATH]
[--vis_save_path VIS_SAVE_PATH]

optional arguments:
-h, --help show this help message and exit
-img IMG_PATH, --img_path IMG_PATH
-p, --print_cost

Expand Down Expand Up @@ -98,9 +78,45 @@ Rec:
--rec_model_path REC_MODEL_PATH
--rec_img_shape REC_IMG_SHAPE
--rec_batch_num REC_BATCH_NUM

Visual Result:
-vis, --vis_res
--vis_font_path VIS_FONT_PATH
When -vis is True, the font_path must have value.
--vis_save_path VIS_SAVE_PATH
The directory of saving the vis image.
```

### 图像预测
### 使用示例
{{< alert text="以下只给出常见用例,具体可自行探索使用" />}}

{{< tabs tabTotal="4">}}
{{% tab tabName="图像预测" %}}

```bash {linenos=table}
rapidocr_onnxruntime -img tests/test_files/ch_en_num.jpg
```

{{% /tab %}}
{{% tab tabName="只使用检测" %}}

```bash {linenos=table}
rapidocr_onnxruntime -img tests/test_files/ch_en_num.jpg -no_cls -no_rec
```

{{% /tab %}}
{{% tab tabName="只使用识别" %}}

```bash {linenos=table}
rapidocr_onnxruntime -img tests/test_files/ch_en_num.jpg -no_det -no_cls
```

{{% /tab %}}
{{% tab tabName="可视化查看" %}}

```bash {linenos=table}
raprapidocr_onnxruntime -img tests/test_files/ch_en_num.jpg -vis --vis_font_path resources/fonts/FZYTK.TTF
```

{{% /tab %}}
{{< /tabs >}}
12 changes: 2 additions & 10 deletions content/docs/install_usage/rapidocr/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ tags:
categories:
---

<p>
<a href=""><img src="https://img.shields.io/badge/Python->=3.6,<3.12-aff.svg"></a>
<a href=""><img src="https://img.shields.io/badge/OS-Linux%2C%20Win%2C%20Mac-pink.svg"></a>
<a href="https://pypi.org/project/rapidocr-onnxruntime/"><img alt="PyPI" src="https://img.shields.io/pypi/v/rapidocr-onnxruntime?style=flat-square"></a>
<a href="https://pepy.tech/project/rapidocr_onnxruntime"><img src="https://static.pepy.tech/personalized-badge/rapidocr_onnxruntime?period=total&units=abbreviation&left_color=grey&right_color=blue&left_text=Downloads%20Ort"></a>
</p>


### 初始化
[RapidOCR](https://github.com/RapidAI/RapidOCR/blob/a981e21743f03d9bbfbe596974123fecfe8a7d62/python/rapidocr_onnxruntime/main.py#L19)是主类,其初始化函数如下:
```python {linenos=table}
Expand Down Expand Up @@ -296,7 +288,7 @@ engine = RapidOCR()
vis = VisRes(font_path="resources/fonts/FZYTK.TTF")

image_path = "tests/test_files/ch_en_num.jpg"
result, elapse_list = rapid_ocr(img)
result, elapse_list = engine(img)
boxes, txts, scores = list(zip(*result))
res = vis(img, boxes, None, None)
cv2.imwrite("only_vis_det.png", res)
Expand All @@ -314,7 +306,7 @@ engine = RapidOCR()
vis = VisRes(font_path="resources/fonts/FZYTK.TTF")

image_path = "tests/test_files/ch_en_num.jpg"
result, elapse_list = rapid_ocr(img)
result, elapse_list = engine(img)
boxes, txts, scores = list(zip(*result))
res = vis(img, boxes, txts, scores)
cv2.imwrite("vis_det_rec.png", res)
Expand Down
41 changes: 41 additions & 0 deletions content/docs/sponsor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
weight: 100
title: "给作者加油🥤"
description: ""
icon: article
date: 2022-11-22T12:36:15+00:00
lastmod: 2022-11-22T12:36:15+00:00
draft: false
images: []
---

> 虽然AI技术偶尔被用于作恶,但我更相信它能给人类和其他生命带来温暖。这是我创建和持续优化这些开源项目的最大动力。它们不是为了展示技术的强大,而是为了给有需要的人带来方便和帮助。通过对这些项目的捐赠,您可以和我一道让AI为更多人带来温暖和美好。
>
> My unwavering love for artificial intelligence technology drives me to constantly seek new challenges and opportunities. This is why I have created these open-sourced projects, which aim not just to demonstrate technical prowess, but more importantly, to bring convenience and help to those who need it. I truly believe that these projects have the power to change lives for the better. Seeing the positive impact of my work fills me with a sense of happiness and pride that fuels my drive to continue creating and innovating.
>
> By supporting my projects through a donation, you can be a part of this journey and help me bring more warmth and humanity to the world of AI. [^1]

### 1. 知识星球RapidAI私享群
这里的提问会优先得到回答和支持,也会享受到RapidAI组织后续持续优质的服务,欢迎大家的加入。

<div align="center">
<img src="https://raw.githubusercontent.com/RapidAI/.github/main/assets/KnowledgePlanet.jpg" width="25%" height="25%">
</div>

### 2. 支付宝或微信打赏 (Alipay reward or WeChat reward)
通过支付宝或者微信给作者打赏,请写好备注。 Give the author a reward through Alipay or WeChat.

<div align="center">
<img src="https://raw.githubusercontent.com/RapidAI/.github/6db6b6b9273f3151094a462a61fbc8e88564562c/assets/Sponsor.png" width="50%" height="50%">
</div>

### 3. Buy me a Coffee
If you are not in mainland China, you can also support the author through:

<div align="center">
<a href="https://www.buymeacoffee.com/SWHL"><img src="https://raw.githubusercontent.com/RapidAI/.github/main/assets/buymeacoffe.png" width="50%" height="50%"></a>
</div>


[^1]: [breezedeus](https://github.com/breezedeus)

0 comments on commit cfda91f

Please sign in to comment.