File tree Expand file tree Collapse file tree 2 files changed +45
-5
lines changed
docs/install_usage/rapidocr Expand file tree Collapse file tree 2 files changed +45
-5
lines changed Original file line number Diff line number Diff line change 99<a href =" https://pepy.tech/project/rapidocr " ><img src =" https://static.pepy.tech/personalized-badge/rapidocr?period=total&units=abbreviation&left_color=grey&right_color=blue&left_text=🔥%20Downloads%20rapidocr " ></a >
1010<a href =" https://pypi.org/project/rapidocr/ " ><img alt =" PyPI " src =" https://img.shields.io/pypi/v/rapidocr " ></a >
1111
12+ !!! warning
13+
14+ `rapidocr_onnxruntime`, `rapidocr_openvino`, `rapidocr_paddle`三个库逐渐不再维护,后续会以`rapidocr`为主。
15+
1216#### 简介
1317
1418` rapidocr ` 是合并了` rapidocr_onnxruntime ` 、` rapidocr_openvino ` 、` rapidocr_paddle ` 以及支持PyTorch推理的版本。
1519
1620` rapidocr ` 默认支采用ONNXRuntime CPU版作为推理引擎,可以通过安装其他推理引擎,通过相应参数来使用GPU推理。该部分请参见后续文档。
1721
18- !!! note
19-
20- `rapidocr_onnxruntime`, `rapidocr_openvino`, `rapidocr_paddle`三个库逐渐不再维护,后续会以`rapidocr`为主。
21-
2222#### 安装
2323
2424顺利的话,一行命令即可。包大小约为15M左右,包含三个模型:文本检测、文本行方向分类和文本识别。其中mobile版模型较小,因此将相关模型都已打到whl包,可直接pip安装使用。
Original file line number Diff line number Diff line change 1010
1111#### 最简单的使用
1212
13- #### 输入
13+ 一切都使用默认值。默认使用来自PP-OCRv4的DBNet中文轻量检测,来自PP-OCRv4的SVTR_LCNet中文识别模型。默认使用onnxruntime CPU版作为推理模型。
14+
15+ 其他默认值的详细参数设置参见:[ ` config.yaml ` ] ( https://github.com/RapidAI/RapidOCR/blob/main/python/rapidocr/config.yaml )
16+
17+ ``` python linenums="1"
18+ from rapidocr import RapidOCR
19+
20+ engine = RapidOCR()
21+
22+ img_url = " https://github.com/RapidAI/RapidOCR/blob/main/python/tests/test_files/ch_en_num.jpg?raw=true"
23+ result = engine(img_url)
24+ print (result)
25+
26+ result.vis()
27+ ```
28+
29+ #### 初始化RapidOCR实例输入
30+
31+ 输入支持传入YAML格式的配置文件,同时支持参数直接传入使用。
32+
33+ === "传入` config.yaml ` 使用"
34+
35+ 自定义`config.yaml`配置,
36+
37+ ```bash linenums="1"
38+ rapidocr -img "https://github.com/RapidAI/RapidOCR/blob/main/python/tests/test_files/ch_en_num.jpg?raw=true" --vis_res
39+ ```
40+
41+ === "直接传入参数"
42+
43+ ```python linenums="1"
44+ from rapidocr import RapidOCR
45+
46+ engine = RapidOCR()
47+
48+ img_url = "https://github.com/RapidAI/RapidOCR/blob/main/python/tests/test_files/ch_en_num.jpg?raw=true"
49+ result = engine(img_url)
50+ print(result)
51+
52+ result.vis()
53+ ```
1454
1555#### 输出
1656
You can’t perform that action at this time.
0 commit comments