Skip to content

Commit 1e143b0

Browse files
committed
docs: add command line usage documentation of quickstart page
1 parent 4b35b75 commit 1e143b0

File tree

2 files changed

+192
-2
lines changed

2 files changed

+192
-2
lines changed

docs/quick_start.en.md

Lines changed: 96 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ hide:
1010
pip install paddleocr
1111
```
1212

13-
### Use
13+
### Use by code
1414

1515
=== "Detection + Classification + Recognition"
1616

@@ -169,6 +169,101 @@ pip install paddleocr
169169
['0', 0.99999964]
170170
```
171171

172+
### Usy by command line
173+
174+
Show help information
175+
176+
```bash linenums="1"
177+
paddleocr -h
178+
```
179+
180+
=== "Detection + Classification + Recognition"
181+
182+
```bash linenums="1"
183+
paddleocr --image_dir PaddleOCR/doc/imgs_en/img_12.jpg --use_angle_cls true --lang en
184+
```
185+
186+
Output will be a list, each item contains bounding box, text and recognition confidence
187+
188+
```python linenums="1"
189+
[[[442.0, 173.0], [1169.0, 173.0], [1169.0, 225.0], [442.0, 225.0]], ['ACKNOWLEDGEMENTS', 0.99283075]]
190+
[[[393.0, 340.0], [1207.0, 342.0], [1207.0, 389.0], [393.0, 387.0]], ['We would like to thank all the designers and', 0.9357758]]
191+
[[[399.0, 398.0], [1204.0, 398.0], [1204.0, 433.0], [399.0, 433.0]], ['contributors whohave been involved in the', 0.9592447]]
192+
......
193+
```
194+
195+
pdf file is also supported, you can infer the first few pages by using the page_num parameter, the default is 0, which means infer all pages
196+
197+
```bash linenums="1"
198+
paddleocr --image_dir ./xxx.pdf --use_angle_cls true --use_gpu false --page_num 2
199+
```
200+
201+
=== "Detection + Recognition"
202+
203+
```bash linenums="1"
204+
paddleocr --image_dir PaddleOCR/doc/imgs_en/img_12.jpg --lang en
205+
```
206+
207+
Output will be a list, each item contains bounding box, text and recognition confidence
208+
209+
```python linenums="1"
210+
[[[442.0, 173.0], [1169.0, 173.0], [1169.0, 225.0], [442.0, 225.0]], ['ACKNOWLEDGEMENTS', 0.99283075]]
211+
[[[393.0, 340.0], [1207.0, 342.0], [1207.0, 389.0], [393.0, 387.0]], ['We would like to thank all the designers and', 0.9357758]]
212+
[[[399.0, 398.0], [1204.0, 398.0], [1204.0, 433.0], [399.0, 433.0]], ['contributors whohave been involved in the', 0.9592447]]
213+
......
214+
```
215+
216+
=== "Classification + Recognition"
217+
218+
```bash linenums="1"
219+
paddleocr --image_dir PaddleOCR/doc/imgs_words_en/word_10.png --use_angle_cls true --det false --lang en
220+
```
221+
222+
Output will be a list, each item contains text and recognition confidence
223+
224+
```python linenums="1"
225+
['PAIN', 0.990372]
226+
```
227+
228+
=== "Only detection"
229+
230+
```bash linenums="1"
231+
paddleocr --image_dir PaddleOCR/doc/imgs_en/img_12.jpg --rec false
232+
```
233+
234+
Output will be a list, each item only contains bounding box
235+
236+
```python linenums="1"
237+
[[756.0, 812.0], [805.0, 812.0], [805.0, 830.0], [756.0, 830.0]]
238+
[[820.0, 803.0], [1085.0, 801.0], [1085.0, 836.0], [820.0, 838.0]]
239+
[[393.0, 801.0], [715.0, 805.0], [715.0, 839.0], [393.0, 836.0]]
240+
......
241+
```
242+
243+
=== "Only recognition"
244+
245+
```bash linenums="1"
246+
paddleocr --image_dir PaddleOCR/doc/imgs_words_en/word_10.png --det false --lang en
247+
```
248+
249+
Output will be a list, each item contains text and recognition confidence
250+
251+
```python linenums="1"
252+
['PAIN', 0.990372]
253+
```
254+
255+
=== "Only classification"
256+
257+
```bash linenums="1"
258+
paddleocr --image_dir PaddleOCR/doc/imgs_words_en/word_10.png --use_angle_cls true --det false --rec false
259+
```
260+
261+
Output will be a list, each item contains classification result and confidence
262+
263+
```python linenums="1"
264+
['0', 0.99999964]
265+
```
266+
172267
### Online Demo
173268

174269
- PP-OCRv4 online experience:<https://aistudio.baidu.com/aistudio/projectdetail/6611435>

docs/quick_start.md

Lines changed: 96 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ hide:
1010
pip install paddleocr
1111
```
1212

13-
### 使用
13+
### Python脚本使用
1414

1515
=== "文本检测+方向分类+文本识别"
1616

@@ -169,6 +169,101 @@ pip install paddleocr
169169
['0', 0.99999964]
170170
```
171171

172+
### 命令行使用
173+
174+
显示帮助信息
175+
176+
```bash linenums="1"
177+
paddleocr -h
178+
```
179+
180+
=== "文本检测+方向分类+文本识别"
181+
182+
```bash linenums="1"
183+
paddleocr --image_dir PaddleOCR/doc/imgs_en/img_12.jpg --use_angle_cls true --lang en
184+
```
185+
186+
输出示例:
187+
188+
```python linenums="1"
189+
[[[442.0, 173.0], [1169.0, 173.0], [1169.0, 225.0], [442.0, 225.0]], ['ACKNOWLEDGEMENTS', 0.99283075]]
190+
[[[393.0, 340.0], [1207.0, 342.0], [1207.0, 389.0], [393.0, 387.0]], ['We would like to thank all the designers and', 0.9357758]]
191+
[[[399.0, 398.0], [1204.0, 398.0], [1204.0, 433.0], [399.0, 433.0]], ['contributors whohave been involved in the', 0.9592447]]
192+
......
193+
```
194+
195+
还支持pdf文件,您可以使用`page_num`参数推断前几页,默认值为0,这意味着识别全部页面
196+
197+
```bash linenums="1"
198+
paddleocr --image_dir ./xxx.pdf --use_angle_cls true --use_gpu false --page_num 2
199+
```
200+
201+
=== "文本检测+文本识别"
202+
203+
```bash linenums="1"
204+
paddleocr --image_dir PaddleOCR/doc/imgs_en/img_12.jpg --lang en
205+
```
206+
207+
输出示例:
208+
209+
```python linenums="1"
210+
[[[442.0, 173.0], [1169.0, 173.0], [1169.0, 225.0], [442.0, 225.0]], ['ACKNOWLEDGEMENTS', 0.99283075]]
211+
[[[393.0, 340.0], [1207.0, 342.0], [1207.0, 389.0], [393.0, 387.0]], ['We would like to thank all the designers and', 0.9357758]]
212+
[[[399.0, 398.0], [1204.0, 398.0], [1204.0, 433.0], [399.0, 433.0]], ['contributors whohave been involved in the', 0.9592447]]
213+
......
214+
```
215+
216+
=== "方向分类+文本识别"
217+
218+
```bash linenums="1"
219+
paddleocr --image_dir PaddleOCR/doc/imgs_words_en/word_10.png --use_angle_cls true --det false --lang en
220+
```
221+
222+
输出示例:
223+
224+
```python linenums="1"
225+
['PAIN', 0.990372]
226+
```
227+
228+
=== "只有文本检测"
229+
230+
```bash linenums="1"
231+
paddleocr --image_dir PaddleOCR/doc/imgs_en/img_12.jpg --rec false
232+
```
233+
234+
输出示例:
235+
236+
```python linenums="1"
237+
[[756.0, 812.0], [805.0, 812.0], [805.0, 830.0], [756.0, 830.0]]
238+
[[820.0, 803.0], [1085.0, 801.0], [1085.0, 836.0], [820.0, 838.0]]
239+
[[393.0, 801.0], [715.0, 805.0], [715.0, 839.0], [393.0, 836.0]]
240+
......
241+
```
242+
243+
=== "只有识别"
244+
245+
```bash linenums="1"
246+
paddleocr --image_dir PaddleOCR/doc/imgs_words_en/word_10.png --det false --lang en
247+
```
248+
249+
输出示例:
250+
251+
```python linenums="1"
252+
['PAIN', 0.990372]
253+
```
254+
255+
=== "只有方向分类"
256+
257+
```bash linenums="1"
258+
paddleocr --image_dir PaddleOCR/doc/imgs_words_en/word_10.png --use_angle_cls true --det false --rec false
259+
```
260+
261+
输出示例:
262+
263+
```python linenums="1"
264+
['0', 0.99999964]
265+
```
266+
172267
### 在线demo
173268

174269
- PP-OCRv4 在线体验地址:<https://aistudio.baidu.com/community/app/91660>

0 commit comments

Comments
 (0)