update demo docs (#166)

* update demo docs

* update docs
pull/168/head
Hongbin Sun 2021-05-11 21:13:19 +08:00 committed by GitHub
parent 3ccec09106
commit 45d22b12c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 30 deletions

View File

@ -1,9 +1,8 @@
# Demo
This page provides tutorials about running demos. Please click the caption for more information.
This page provides tutorials about running demos. Please click the link below for more information.
Please refer to [Text Detection](../docs/text_det_demo.md) for the tutorial of Text Detection demo.
<br>
<div align="center">
<img src="../resources/demo_text_det_pred.jpg"/><br>
@ -13,11 +12,19 @@ Please refer to [Text Detection](../docs/text_det_demo.md) for the tutorial of T
<br>
Please refer to [Text Recognition](../docs/text_recog_demo.md) for the tutorial of Text Recognition demo.
<br>
<div align="center">
<img src="../resources/demo_text_recog_pred.jpg" width="200px" alt/><br>
</div>
<br>
<br>
Please refer to [End2End Demo](../docs/ocr_demo.md) for the tutorial of Text Detection and Recognition end-to-end demo.
<div align="center">
<img src="../resources/demo_ocr_pred.jpg"/><br>
</div>
<br>

19
docs/ocr_demo.md 100644
View File

@ -0,0 +1,19 @@
## OCR End2End Demo
### End-to-End Test Image Demo
To end-to-end test a single image with text detection and recognition simutaneously:
```shell
python demo/ocr_image_demo.py demo/demo_text_det.jpg demo/output.jpg
```
- The default config for text detection and recognition are [PSENet_ICDAR2015](../configs/textdet/psenet/psenet_r50_fpnf_600e_icdar2015.py) and [SAR](../configs/textrecog/sar/sar_r31_parallel_decoder_academic.py), respectively.
- The predicted result will be saved as `demo/output.jpg`.
- To use other algorithms of text detection and recognition, please set arguments: `--det-config`, `--det-ckpt`, `--recog-config`, `--recog-ckpt`.
### Remarks
1. If `--imshow` is specified, the demo will also show the image with OpenCV.
2. The `ocr_image_demo.py` script only supports GPU and so the `--device` parameter cannot take cpu as an argument.

View File

@ -3,11 +3,11 @@
### Text Detection Image Demo
We provide a demo script to test a [single demo image](demo/demo_text_det.jpg) for text detection with a single GPU.
We provide a demo script to test a [single image](../demo/demo_text_det.jpg) for text detection with a single GPU.
*Text Detection Model Preparation:*
The pre-trained text detection model can be downloaded from [model zoo](https://mmocr.readthedocs.io/en/latest/modelzoo.html).
Take [PANet](https://download.openmmlab.com/mmocr/textdet/panet/panet_r18_fpem_ffm_sbn_600e_icdar2015_20210219-42dbe46a.pth) (pre-trained with ICDAR2015 for 600 epochs) as an example:
Take [PANet](../configs/textdet/panet/panet_r18_fpem_ffm_600e_icdar2015.py) as an example:
```shell
python demo/image_demo.py ${TEST_IMG} ${CONFIG_FILE} ${CHECKPOINT_FILE} ${SAVE_PATH} [--imshow] [--device ${GPU_ID}]
@ -41,17 +41,7 @@ python demo/webcam_demo.py \
configs/textdet/panet/panet_r18_fpem_ffm_600e_icdar2015.py \ https://download.openmmlab.com/mmocr/textdet/panet/panet_r18_fpem_ffm_sbn_600e_icdar2015_20210219-42dbe46a.pth
```
### End-to-End Test Image Demo
To end-to-end test a single image with text detection and recognition simutaneously:
```shell
python demo/ocr_image_demo.py demo/demo_text_det.jpg demo/output.jpg
```
The default config for text detection and recognition are [PSENet_ICDAR2015](./configs/textdet/psenet/psenet_r50_fpnf_600e_icdar2015.py) and [SAR](./configs/textrecog/sar/sar_r31_parallel_decoder_academic.py), respectively.
### Remarks
1. If `--imshow` is specified, the demo will also show the image with OpenCV.
2. The `demo.py` script only supports GPU and so the `--device` parameter cannot take cpu as an argument.
2. The `image_demo.py` script only supports GPU and so the `--device` parameter cannot take cpu as an argument.

View File

@ -3,11 +3,11 @@
### Text Recognition Image Demo
We provide a demo script to test a [single demo image](demo/demo_text_recog.jpg) for text recognition with a single GPU.
We provide a demo script to test a [single demo image](../demo/demo_text_recog.jpg) for text recognition with a single GPU.
*Text Recognition Model Preparation:*
The pre-trained text recognition model can be downloaded from [model zoo](https://mmocr.readthedocs.io/en/latest/modelzoo.html).
Take [SAR](https://download.openmmlab.com/mmocr/textrecog/sar/sar_r31_parallel_decoder_academic-dba3a4a3.pth) as an example:
Take [SAR](../configs/textrecog/sar/sar_r31_parallel_decoder_academic.py) as an example:
```shell
python demo/image_demo.py ${TEST_IMG} ${CONFIG_FILE} ${CHECKPOINT_FILE} ${SAVE_PATH} [--imshow] [--device ${GPU_ID}]
@ -42,17 +42,7 @@ python demo/webcam_demo.py \
https://download.openmmlab.com/mmocr/textrecog/sar/sar_r31_parallel_decoder_academic-dba3a4a3.pth
```
### End-to-End Test Image Demo
To end-to-end test a single image with text detection and recognition simutaneously:
```shell
python demo/ocr_image_demo.py demo/demo_text_det.jpg demo/output.jpg
```
The default config for text detection and recognition are [PSENet_ICDAR2015](./configs/textdet/psenet/psenet_r50_fpnf_600e_icdar2015.py) and [SAR](./configs/textrecog/sar/sar_r31_parallel_decoder_academic.py), respectively.
### Remarks
1. If `--imshow` is specified, the demo will also show the image with OpenCV.
2. The `demo.py` script only supports GPU and so the `--device` parameter cannot take cpu as an argument.
2. The `image_demo.py` script only supports GPU and so the `--device` parameter cannot take cpu as an argument.

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 KiB

After

Width:  |  Height:  |  Size: 73 KiB