Skip to content

Commit

Permalink
chore: Update ppocr zh_cn model to ppocr v4
Browse files Browse the repository at this point in the history
  • Loading branch information
dongwlin committed Sep 29, 2023
1 parent f7cc860 commit 2958013
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 47 deletions.
56 changes: 9 additions & 47 deletions assets/resource/model/ocr/README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,23 @@
# PaddleOCR model

2023/07/06
2023/09/29

from <https://github.com/PaddlePaddle/PaddleOCR/blob/795c81f1835725dbf9bf9f5a13e0c793dfd5f243/doc/doc_en/models_list_en.md>
from <https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.7/doc/doc_ch/models_list.md>

## det model

ch_PP-OCRv3_det [New] Original lightweight model, supporting Chinese, English, multilingual text detection
ch_PP-OCRv4_det
【最新】原始超轻量模型,支持中英文、多语种文本检测

<https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar>
<https://paddleocr.bj.bcebos.com/PP-OCRv4/chinese/ch_PP-OCRv4_det_infer.tar>

## rec model

ch_PP-OCRv3_rec [New] Original lightweight model, supporting Chinese, English, multilingual text recognition
ch_PP-OCRv4_rec
【最新】超轻量模型,支持中英文、数字识别

<https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar>
<https://paddleocr.bj.bcebos.com/PP-OCRv4/chinese/ch_PP-OCRv4_rec_infer.tar>

## rec label

<https://github.com/PaddlePaddle/PaddleOCR/blob/795c81f1835725dbf9bf9f5a13e0c793dfd5f243/ppocr/utils/ppocr_keys_v1.txt>

## command

### det

```bash
$ paddle2onnx --model_dir . --model_filename inference.pdmodel --params_filename inference.pdiparams --save_file det_unopt.onnx --opset_version 16 --enable_dev_version True --enable_onnx_checker True --deploy_backend onnxruntime
[Paddle2ONNX] Start to parse PaddlePaddle model...
[Paddle2ONNX] Model file path: ./inference.pdmodel
[Paddle2ONNX] Paramters file path: ./inference.pdiparams
[Paddle2ONNX] Start to parsing Paddle model...
[Paddle2ONNX] Use opset_version = 16 for ONNX export.
[Paddle2ONNX] PaddlePaddle model is exported as ONNX format now.
2023-07-06 23:36:40 [INFO] ===============Make PaddlePaddle Better!================
2023-07-06 23:36:40 [INFO] A little survey: https://iwenjuan.baidu.com/?code=r8hu2s
```

```bash
$ python -m paddle2onnx.optimize --input_model det_unopt.onnx --output_model det.onnx
2023-07-06 23:37:06 [INFO] Model optmized, saved in det.onnx.
```

### rec

```bash
$ paddle2onnx --model_dir . --model_filename inference.pdmodel --params_filename inference.pdiparams --save_file rec_unopt.onnx --opset_version 16 --enable_dev_version True --enable_onnx_checker True --deploy_backend onnxruntime
[Paddle2ONNX] Start to parse PaddlePaddle model...
[Paddle2ONNX] Model file path: ./inference.pdmodel
[Paddle2ONNX] Paramters file path: ./inference.pdiparams
[Paddle2ONNX] Start to parsing Paddle model...
[Paddle2ONNX] Use opset_version = 16 for ONNX export.
[Paddle2ONNX] PaddlePaddle model is exported as ONNX format now.
2023-07-06 23:37:28 [INFO] ===============Make PaddlePaddle Better!================
2023-07-06 23:37:28 [INFO] A little survey: https://iwenjuan.baidu.com/?code=r8hu2s
```

```bash
$ python -m paddle2onnx.optimize --input_model rec_unopt.onnx --output_model rec.onnx
2023-07-06 23:37:37 [INFO] Model optmized, saved in rec.onnx.
```
<https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.6/ppocr/utils/ppocr_keys_v1.txt>
Binary file modified assets/resource/model/ocr/det.onnx
Binary file not shown.
Binary file modified assets/resource/model/ocr/rec.onnx
Binary file not shown.

0 comments on commit 2958013

Please sign in to comment.