From cfda91fc65162b9d5f9d681171a34eb67d5c3adf Mon Sep 17 00:00:00 2001 From: SWHL Date: Thu, 21 Sep 2023 10:54:50 +0800 Subject: [PATCH] Update docs --- content/docs/communicate.md | 31 ++++++ content/docs/install_usage/rapidocr/cli.md | 108 +++++++++++-------- content/docs/install_usage/rapidocr/usage.md | 12 +-- content/docs/sponsor.md | 41 +++++++ 4 files changed, 136 insertions(+), 56 deletions(-) create mode 100644 content/docs/communicate.md create mode 100644 content/docs/sponsor.md diff --git a/content/docs/communicate.md b/content/docs/communicate.md new file mode 100644 index 00000000..67b1d01c --- /dev/null +++ b/content/docs/communicate.md @@ -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组织后续持续优质的服务,欢迎大家的加入。 + +
+ +
+ +### 微信交流群 +微信扫描以下二维码,关注RapidAI公众号,回复OCR即可加入RapidOCR微信交流群: +
+ +
+ +### QQ交流群 +欢迎加入我们的QQ群下载模型及测试程序。1群:~887298230~ 已满,2群:~755960114~ 已满,3群:450338158 +
+ +
diff --git a/content/docs/install_usage/rapidocr/cli.md b/content/docs/install_usage/rapidocr/cli.md index 45bab7be..aa37bf8c 100644 --- a/content/docs/install_usage/rapidocr/cli.md +++ b/content/docs/install_usage/rapidocr/cli.md @@ -12,56 +12,36 @@ tags: categories: --- -

- - - PyPI - -

- `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 @@ -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 >}} diff --git a/content/docs/install_usage/rapidocr/usage.md b/content/docs/install_usage/rapidocr/usage.md index eba9e087..4fb7e152 100644 --- a/content/docs/install_usage/rapidocr/usage.md +++ b/content/docs/install_usage/rapidocr/usage.md @@ -12,14 +12,6 @@ tags: categories: --- -

- - - PyPI - -

- - ### 初始化 类[RapidOCR](https://github.com/RapidAI/RapidOCR/blob/a981e21743f03d9bbfbe596974123fecfe8a7d62/python/rapidocr_onnxruntime/main.py#L19)是主类,其初始化函数如下: ```python {linenos=table} @@ -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) @@ -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) diff --git a/content/docs/sponsor.md b/content/docs/sponsor.md new file mode 100644 index 00000000..dbaa4fe2 --- /dev/null +++ b/content/docs/sponsor.md @@ -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组织后续持续优质的服务,欢迎大家的加入。 + +
+ +
+ +### 2. 支付宝或微信打赏 (Alipay reward or WeChat reward) +通过支付宝或者微信给作者打赏,请写好备注。 Give the author a reward through Alipay or WeChat. + +
+ +
+ +### 3. Buy me a Coffee +If you are not in mainland China, you can also support the author through: + +
+ +
+ + +[^1]: [breezedeus](https://github.com/breezedeus) \ No newline at end of file