Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
PaddleOCR_paddle_onnxruntime
Commits
bfa06222
Commit
bfa06222
authored
Oct 27, 2023
by
chenxj
Browse files
update README
parent
3319845c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
15 deletions
+17
-15
README.md
README.md
+15
-13
model.properties
model.properties
+2
-2
No files found.
README.md
View file @
bfa06222
...
@@ -27,6 +27,17 @@ cls:
...
@@ -27,6 +27,17 @@ cls:


## 算法原理
## 算法原理


## 环境配置
在
[
光源
](
https://www.sourcefind.cn/#/service-details
)
可拉取训练以及推理的docker镜像,在
[
光合开发者社区
](
https://cancon.hpccube.com:65024/4/main/
)
可下载paddle、onnxruntime安装包。PaddleOCR推荐的镜像如下:
```
docker pull image.sourcefind.cn:5000/dcu/admin/base/paddlepaddle:2.4.2-centos7.6-dtk-23.04.1-py37-latest
docker run -d -t --privileged --device=/dev/kfd --device=/dev/dri/ --shm-size 64g --network=host --group-add video --name paddleocr-test image.sourcefind.cn:5000/dcu/admin/base/paddlepaddle:2.3.2-centos7.6-dtk-22.10.1-py37-latest
docker exec -it paddleocr-test bash
pip3 install -r requirements.txt
pip3 install onnxruntime.whl
wget -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/pretrained/MobileNetV3_large_x0_5_pretrained.pdparams
wget -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv3/english/en_PP-OCRv3_rec_train.tar
```
## 数据集
## 数据集
推荐使用icdar2015数据集
[
icdar2015
](
https://rrc.cvc.uab.es/?ch=4&com=downloads
)
。
推荐使用icdar2015数据集
[
icdar2015
](
https://rrc.cvc.uab.es/?ch=4&com=downloads
)
。
...
@@ -56,17 +67,6 @@ cls:
...
@@ -56,17 +67,6 @@ cls:
|- word_003.jpg
|- word_003.jpg
| ...
| ...
```
```
## 环境配置
在
[
光源
](
https://www.sourcefind.cn/#/service-details
)
可拉取训练以及推理的docker镜像,在
[
光合开发者社区
](
https://cancon.hpccube.com:65024/4/main/
)
可下载paddle、onnxruntime安装包。PaddleOCR推荐的镜像如下:
```
docker pull image.sourcefind.cn:5000/dcu/admin/base/paddlepaddle:2.4.2-centos7.6-dtk-23.04.1-py37-latest
docker run -d -t --privileged --device=/dev/kfd --device=/dev/dri/ --shm-size 64g --network=host --group-add video --name paddleocr-test image.sourcefind.cn:5000/dcu/admin/base/paddlepaddle:2.3.2-centos7.6-dtk-22.10.1-py37-latest
docker exec -it paddleocr-test bash
pip3 install -r requirements.txt
pip3 install onnxruntime.whl
wget -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/pretrained/MobileNetV3_large_x0_5_pretrained.pdparams
wget -P ./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv3/english/en_PP-OCRv3_rec_train.tar
```
## 训练
## 训练
检测模型
检测模型
...
@@ -78,6 +78,7 @@ python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/train.py -c configs
...
@@ -78,6 +78,7 @@ python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/train.py -c configs
python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/train.py -c configs/rec/PP-OCRv3/en_PP-OCRv3_rec.yml -o Global.pretrained_model=./pretrain_models/en_PP-OCRv3_rec_train/best_accuracy
python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/train.py -c configs/rec/PP-OCRv3/en_PP-OCRv3_rec.yml -o Global.pretrained_model=./pretrain_models/en_PP-OCRv3_rec_train/best_accuracy
```
```
## 测试
## 测试
### 测试(paddle)
检测模型
检测模型
```
```
python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/eval.py -c configs/det/det_mv3_db.yml -o Global.pretrained_model=./output/db_mv3/best_accuracy.pdparams
python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/eval.py -c configs/det/det_mv3_db.yml -o Global.pretrained_model=./output/db_mv3/best_accuracy.pdparams
...
@@ -86,7 +87,7 @@ python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/eval.py -c configs/
...
@@ -86,7 +87,7 @@ python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/eval.py -c configs/
```
```
python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/eval.py -c configs/rec/PP-OCRv3/en_PP-OCRv3_rec.yml -o Global.pretrained_model=./output/v3_en_mobile/best_accuracy.pdparams
python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/eval.py -c configs/rec/PP-OCRv3/en_PP-OCRv3_rec.yml -o Global.pretrained_model=./output/v3_en_mobile/best_accuracy.pdparams
```
```
## 测试(ort)
##
#
测试(ort)
检测模型
检测模型
```
```
python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/eval.py -c configs/det/det_mv3_db.yml -o Global.pretrained_model=./ch_PP-OCRv3_det_infer/ch_PP-OCRv3_det.onnx --use_onnx=true
python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/eval.py -c configs/det/det_mv3_db.yml -o Global.pretrained_model=./ch_PP-OCRv3_det_infer/ch_PP-OCRv3_det.onnx --use_onnx=true
...
@@ -96,10 +97,11 @@ python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/eval.py -c configs/
...
@@ -96,10 +97,11 @@ python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/eval.py -c configs/
python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/eval.py -c configs/rec/PP-OCRv3/ch_PP-OCRv3_rec.yml -o Global.pretrained_model=./ch_PP-OCRv3_rec_infer/ch_PP-OCRv3_rec.onnx --use_onnx=true
python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/eval.py -c configs/rec/PP-OCRv3/ch_PP-OCRv3_rec.yml -o Global.pretrained_model=./ch_PP-OCRv3_rec_infer/ch_PP-OCRv3_rec.onnx --use_onnx=true
```
```
## 推理
## 推理
### 推理(paddle)
```
```
python3 tools/infer/predict_system.py --image_dir="./doc/imgs/" --det_model_dir="./ch_PP-OCRv3_det_infer/" --cls_model_dir="./ch_ppocr_mobile_v2.0_cls_infer/" --rec_model_dir="./ch_PP-OCRv3_rec_infer/" --use_angle_cls=true --rec_image_shape=3,48,320 --warmup=1
python3 tools/infer/predict_system.py --image_dir="./doc/imgs/" --det_model_dir="./ch_PP-OCRv3_det_infer/" --cls_model_dir="./ch_ppocr_mobile_v2.0_cls_infer/" --rec_model_dir="./ch_PP-OCRv3_rec_infer/" --use_angle_cls=true --rec_image_shape=3,48,320 --warmup=1
```
```
## 推理(ort)
##
#
推理(ort)
```
```
python3 tools/infer/predict_system.py --image_dir="./doc/imgs/" --det_model_dir="./ch_PP-OCRv3_det_infer/ch_PP-OCRv3_det.onnx" --cls_model_dir="./ch_ppocr_mobile_v2.0_cls_infer/ch_ppocr_mobile_v2.0_cls_infer.onnx" --rec_model_dir="./ch_PP-OCRv3_rec_infer/ch_PP-OCRv3_rec.onnx" --use_onnx=true --use_angle_cls=true --rec_image_shape=3,48,320 --warmup=1
python3 tools/infer/predict_system.py --image_dir="./doc/imgs/" --det_model_dir="./ch_PP-OCRv3_det_infer/ch_PP-OCRv3_det.onnx" --cls_model_dir="./ch_ppocr_mobile_v2.0_cls_infer/ch_ppocr_mobile_v2.0_cls_infer.onnx" --rec_model_dir="./ch_PP-OCRv3_rec_infer/ch_PP-OCRv3_rec.onnx" --use_onnx=true --use_angle_cls=true --rec_image_shape=3,48,320 --warmup=1
```
```
...
...
model.properties
View file @
bfa06222
# 模型唯一标识
# 模型唯一标识
modelCode
=
205
modelCode
=
205
# 模型名称
# 模型名称
modelName
=
paddleocr
modelName
=
paddleocr
_paddle_onnxruntime
# 模型描述
# 模型描述
modelDescription
=
paddleocr是一个实现字符检测和识别的模型
modelDescription
=
paddleocr
_paddle_onnxruntime
是一个实现字符检测和识别的模型
# 应用场景
# 应用场景
appScenario
=
推理,训练,OCR,工业制造,金融,交通,教育,医疗
appScenario
=
推理,训练,OCR,工业制造,金融,交通,教育,医疗
# 框架类型
# 框架类型
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment