Commit bfa06222 authored by chenxj's avatar chenxj
Browse files

update README

parent 3319845c
......@@ -27,6 +27,17 @@ cls:
![image](https://developer.hpccube.com/codes/modelzoo/paddleocr/-/raw/main/configs/cls/mobilenetv3-arc.png)
## 算法原理
![image](https://developer.hpccube.com/codes/modelzoo/paddleocr/-/raw/main/configs/ocr.png)
## 环境配置
[光源](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)
......@@ -56,17 +67,6 @@ cls:
|- 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
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
......@@ -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
```
## 测试(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
......@@ -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
```
## 推理
### 推理(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
```
## 推理(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
```
......
# 模型唯一标识
modelCode = 205
# 模型名称
modelName=paddleocr
modelName=paddleocr_paddle_onnxruntime
# 模型描述
modelDescription=paddleocr是一个实现字符检测和识别的模型
modelDescription=paddleocr_paddle_onnxruntime是一个实现字符检测和识别的模型
# 应用场景
appScenario=推理,训练,OCR,工业制造,金融,交通,教育,医疗
# 框架类型
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment