Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
devil_zzz123
PaddleOCR
提交
7bd93832
P
PaddleOCR
项目概览
devil_zzz123
/
PaddleOCR
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleOCR
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
7bd93832
编写于
12月 19, 2020
作者:
D
dyning
提交者:
GitHub
12月 19, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1517 from WenmuZhou/tree_doc
update inference doc
上级
99175c61
b615f670
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
34 addition
and
22 deletion
+34
-22
doc/doc_ch/angle_class.md
doc/doc_ch/angle_class.md
+1
-1
doc/doc_ch/detection.md
doc/doc_ch/detection.md
+3
-3
doc/doc_ch/inference.md
doc/doc_ch/inference.md
+8
-3
doc/doc_ch/recognition.md
doc/doc_ch/recognition.md
+2
-3
doc/doc_en/angle_class_en.md
doc/doc_en/angle_class_en.md
+1
-1
doc/doc_en/detection_en.md
doc/doc_en/detection_en.md
+3
-3
doc/doc_en/inference_en.md
doc/doc_en/inference_en.md
+12
-4
doc/doc_en/recognition_en.md
doc/doc_en/recognition_en.md
+4
-4
未找到文件。
doc/doc_ch/angle_class.md
浏览文件 @
7bd93832
...
@@ -117,7 +117,7 @@ python3 tools/eval.py -c configs/cls/cls_mv3.yml -o Global.checkpoints={path/to/
...
@@ -117,7 +117,7 @@ python3 tools/eval.py -c configs/cls/cls_mv3.yml -o Global.checkpoints={path/to/
```
```
# 预测分类结果
# 预测分类结果
python3 tools/infer_cls.py -c configs/cls/cls_mv3.yml -o Global.
checkpoints={path/to/weights}/best_accuracy
Global.infer_img=doc/imgs_words/ch/word_1.jpg
python3 tools/infer_cls.py -c configs/cls/cls_mv3.yml -o Global.
pretrained_model={path/to/weights}/best_accuracy Global.load_static_weights=false
Global.infer_img=doc/imgs_words/ch/word_1.jpg
```
```
预测图片:
预测图片:
...
...
doc/doc_ch/detection.md
浏览文件 @
7bd93832
...
@@ -120,16 +120,16 @@ python3 tools/eval.py -c configs/det/det_mv3_db.yml -o Global.checkpoints="{pat
...
@@ -120,16 +120,16 @@ python3 tools/eval.py -c configs/det/det_mv3_db.yml -o Global.checkpoints="{pat
测试单张图像的检测效果
测试单张图像的检测效果
```
shell
```
shell
python3 tools/infer_det.py
-c
configs/det/det_mv3_db.yml
-o
Global.infer_img
=
"./doc/imgs_en/img_10.jpg"
Global.
checkpoints
=
"./output/det_db/best_accuracy"
python3 tools/infer_det.py
-c
configs/det/det_mv3_db.yml
-o
Global.infer_img
=
"./doc/imgs_en/img_10.jpg"
Global.
pretrained_model
=
"./output/det_db/best_accuracy"
Global.load_static_weights
=
false
```
```
测试DB模型时,调整后处理阈值,
测试DB模型时,调整后处理阈值,
```
shell
```
shell
python3 tools/infer_det.py
-c
configs/det/det_mv3_db.yml
-o
Global.infer_img
=
"./doc/imgs_en/img_10.jpg"
Global.
checkpoints
=
"./output/det_db/best_accuracy"
PostProcess.box_thresh
=
0.6 PostProcess.unclip_ratio
=
1.5
python3 tools/infer_det.py
-c
configs/det/det_mv3_db.yml
-o
Global.infer_img
=
"./doc/imgs_en/img_10.jpg"
Global.
pretrained_model
=
"./output/det_db/best_accuracy"
Global.load_static_weights
=
false
PostProcess.box_thresh
=
0.6 PostProcess.unclip_ratio
=
1.5
```
```
测试文件夹下所有图像的检测效果
测试文件夹下所有图像的检测效果
```
shell
```
shell
python3 tools/infer_det.py
-c
configs/det/det_mv3_db.yml
-o
Global.infer_img
=
"./doc/imgs_en/"
Global.
checkpoints
=
"./output/det_db/best_accuracy"
python3 tools/infer_det.py
-c
configs/det/det_mv3_db.yml
-o
Global.infer_img
=
"./doc/imgs_en/"
Global.
pretrained_model
=
"./output/det_db/best_accuracy"
Global.load_static_weights
=
false
```
```
doc/doc_ch/inference.md
浏览文件 @
7bd93832
...
@@ -245,7 +245,10 @@ python3 tools/infer/predict_det.py --det_algorithm="SAST" --image_dir="./doc/img
...
@@ -245,7 +245,10 @@ python3 tools/infer/predict_det.py --det_algorithm="SAST" --image_dir="./doc/img
超轻量中文识别模型推理,可以执行如下命令:
超轻量中文识别模型推理,可以执行如下命令:
```
```
python3 tools/infer/predict_rec.py --image_dir="./doc/imgs_words/ch/word_4.jpg" --rec_model_dir="./inference/rec_crnn/"
# 下载超轻量中文识别模型:
wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar
tar xf ch_ppocr_mobile_v2.0_rec_infer.tar
python3 tools/infer/predict_rec.py --image_dir="./doc/imgs_words/ch/word_4.jpg" --rec_model_dir="ch_ppocr_mobile_v2.0_rec_infer"
```
```
![](
../imgs_words/ch/word_4.jpg
)
![](
../imgs_words/ch/word_4.jpg
)
...
@@ -266,7 +269,6 @@ Predicts of ./doc/imgs_words/ch/word_4.jpg:('实力活力', 0.98458153)
...
@@ -266,7 +269,6 @@ Predicts of ./doc/imgs_words/ch/word_4.jpg:('实力活力', 0.98458153)
```
```
python3 tools/export_model.py -c configs/rec/rec_r34_vd_none_bilstm_ctc.yml -o Global.pretrained_model=./rec_r34_vd_none_bilstm_ctc_v2.0_train/best_accuracy Global.load_static_weights=False Global.save_inference_dir=./inference/rec_crnn
python3 tools/export_model.py -c configs/rec/rec_r34_vd_none_bilstm_ctc.yml -o Global.pretrained_model=./rec_r34_vd_none_bilstm_ctc_v2.0_train/best_accuracy Global.load_static_weights=False Global.save_inference_dir=./inference/rec_crnn
```
```
CRNN 文本识别模型推理,可以执行如下命令:
CRNN 文本识别模型推理,可以执行如下命令:
...
@@ -327,7 +329,10 @@ Predicts of ./doc/imgs_words/korean/1.jpg:('바탕으로', 0.9948904)
...
@@ -327,7 +329,10 @@ Predicts of ./doc/imgs_words/korean/1.jpg:('바탕으로', 0.9948904)
方向分类模型推理,可以执行如下命令:
方向分类模型推理,可以执行如下命令:
```
```
python3 tools/infer/predict_cls.py --image_dir="./doc/imgs_words/ch/word_4.jpg" --cls_model_dir="./inference/cls/"
# 下载超轻量中文方向分类器模型:
wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar
tar xf ch_ppocr_mobile_v2.0_cls_infer.tar
python3 tools/infer/predict_cls.py --image_dir="./doc/imgs_words/ch/word_4.jpg" --cls_model_dir="ch_ppocr_mobile_v2.0_cls_infer"
```
```
![](
../imgs_words/ch/word_1.jpg
)
![](
../imgs_words/ch/word_1.jpg
)
...
...
doc/doc_ch/recognition.md
浏览文件 @
7bd93832
...
@@ -324,7 +324,6 @@ Eval:
...
@@ -324,7 +324,6 @@ Eval:
评估数据集可以通过
`configs/rec/rec_icdar15_train.yml`
修改Eval中的
`label_file_path`
设置。
评估数据集可以通过
`configs/rec/rec_icdar15_train.yml`
修改Eval中的
`label_file_path`
设置。
*注意*
评估时必须确保配置文件中 infer_img 字段为空
```
```
# GPU 评估, Global.checkpoints 为待测权重
# GPU 评估, Global.checkpoints 为待测权重
python3 -m paddle.distributed.launch --gpus '0' tools/eval.py -c configs/rec/rec_icdar15_train.yml -o Global.checkpoints={path/to/weights}/best_accuracy
python3 -m paddle.distributed.launch --gpus '0' tools/eval.py -c configs/rec/rec_icdar15_train.yml -o Global.checkpoints={path/to/weights}/best_accuracy
...
@@ -342,7 +341,7 @@ python3 -m paddle.distributed.launch --gpus '0' tools/eval.py -c configs/rec/rec
...
@@ -342,7 +341,7 @@ python3 -m paddle.distributed.launch --gpus '0' tools/eval.py -c configs/rec/rec
```
```
# 预测英文结果
# 预测英文结果
python3 tools/infer_rec.py -c configs/rec/rec_icdar15_train.yml -o Global.
checkpoints={path/to/weights}/best_accuracy
Global.infer_img=doc/imgs_words/en/word_1.png
python3 tools/infer_rec.py -c configs/rec/rec_icdar15_train.yml -o Global.
pretrained_model={path/to/weights}/best_accuracy Global.load_static_weights=false
Global.infer_img=doc/imgs_words/en/word_1.png
```
```
预测图片:
预测图片:
...
@@ -361,7 +360,7 @@ infer_img: doc/imgs_words/en/word_1.png
...
@@ -361,7 +360,7 @@ infer_img: doc/imgs_words/en/word_1.png
```
```
# 预测中文结果
# 预测中文结果
python3 tools/infer_rec.py -c configs/rec/ch_ppocr_v2.0/rec_chinese_lite_train_v2.0.yml -o Global.
checkpoints={path/to/weights}/best_accuracy
Global.infer_img=doc/imgs_words/ch/word_1.jpg
python3 tools/infer_rec.py -c configs/rec/ch_ppocr_v2.0/rec_chinese_lite_train_v2.0.yml -o Global.
pretrained_model={path/to/weights}/best_accuracy Global.load_static_weights=false
Global.infer_img=doc/imgs_words/ch/word_1.jpg
```
```
预测图片:
预测图片:
...
...
doc/doc_en/angle_class_en.md
浏览文件 @
7bd93832
...
@@ -119,7 +119,7 @@ Use `Global.infer_img` to specify the path of the predicted picture or folder, a
...
@@ -119,7 +119,7 @@ Use `Global.infer_img` to specify the path of the predicted picture or folder, a
```
```
# Predict English results
# Predict English results
python3 tools/infer_cls.py -c configs/cls/cls_mv3.yml -o Global.
checkpoints={path/to/weights}/best_accuracy
Global.infer_img=doc/imgs_words_en/word_10.png
python3 tools/infer_cls.py -c configs/cls/cls_mv3.yml -o Global.
pretrained_model={path/to/weights}/best_accuracy Global.load_static_weights=false
Global.infer_img=doc/imgs_words_en/word_10.png
```
```
Input image:
Input image:
...
...
doc/doc_en/detection_en.md
浏览文件 @
7bd93832
...
@@ -113,16 +113,16 @@ python3 tools/eval.py -c configs/det/det_mv3_db.yml -o Global.checkpoints="{pat
...
@@ -113,16 +113,16 @@ python3 tools/eval.py -c configs/det/det_mv3_db.yml -o Global.checkpoints="{pat
Test the detection result on a single image:
Test the detection result on a single image:
```
shell
```
shell
python3 tools/infer_det.py
-c
configs/det/det_mv3_db.yml
-o
Global.infer_img
=
"./doc/imgs_en/img_10.jpg"
Global.
checkpoints
=
"./output/det_db/best_accuracy"
python3 tools/infer_det.py
-c
configs/det/det_mv3_db.yml
-o
Global.infer_img
=
"./doc/imgs_en/img_10.jpg"
Global.
pretrained_model
=
"./output/det_db/best_accuracy"
Global.load_static_weights
=
false
```
```
When testing the DB model, adjust the post-processing threshold:
When testing the DB model, adjust the post-processing threshold:
```
shell
```
shell
python3 tools/infer_det.py
-c
configs/det/det_mv3_db.yml
-o
Global.infer_img
=
"./doc/imgs_en/img_10.jpg"
Global.
checkpoints
=
"./output/det_db/best_accuracy"
PostProcess.box_thresh
=
0.6 PostProcess.unclip_ratio
=
1.5
python3 tools/infer_det.py
-c
configs/det/det_mv3_db.yml
-o
Global.infer_img
=
"./doc/imgs_en/img_10.jpg"
Global.
pretrained_model
=
"./output/det_db/best_accuracy"
Global.load_static_weights
=
false
PostProcess.box_thresh
=
0.6 PostProcess.unclip_ratio
=
1.5
```
```
Test the detection result on all images in the folder:
Test the detection result on all images in the folder:
```
shell
```
shell
python3 tools/infer_det.py
-c
configs/det/det_mv3_db.yml
-o
Global.infer_img
=
"./doc/imgs_en/"
Global.
checkpoints
=
"./output/det_db/best_accuracy"
python3 tools/infer_det.py
-c
configs/det/det_mv3_db.yml
-o
Global.infer_img
=
"./doc/imgs_en/"
Global.
pretrained_model
=
"./output/det_db/best_accuracy"
Global.load_static_weights
=
false
```
```
doc/doc_en/inference_en.md
浏览文件 @
7bd93832
...
@@ -255,15 +255,18 @@ The following will introduce the lightweight Chinese recognition model inference
...
@@ -255,15 +255,18 @@ The following will introduce the lightweight Chinese recognition model inference
For lightweight Chinese recognition model inference, you can execute the following commands:
For lightweight Chinese recognition model inference, you can execute the following commands:
```
```
python3 tools/infer/predict_rec.py --image_dir="./doc/imgs_words/ch/word_4.jpg" --rec_model_dir="./inference/rec_crnn/"
# download CRNN text recognition inference model
wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar
tar xf ch_ppocr_mobile_v2.0_rec_infer.tar
python3 tools/infer/predict_rec.py --image_dir="./doc/imgs_words_en/word_10.png" --rec_model_dir="ch_ppocr_mobile_v2.0_rec_infer"
```
```
![](
../imgs_words
/ch/word_4.jp
g
)
![](
../imgs_words
_en/word_10.pn
g
)
After executing the command, the prediction results (recognized text and score) of the above image will be printed on the screen.
After executing the command, the prediction results (recognized text and score) of the above image will be printed on the screen.
```
bash
```
bash
Predicts of ./doc/imgs_words
/ch/word_4.jpg:
(
'实力活力'
, 0.98458153
)
Predicts of ./doc/imgs_words
_en/word_10.png:
(
'PAIN'
, 0.9897658
)
```
```
<a
name=
"CTC-BASED_RECOGNITION"
></a>
<a
name=
"CTC-BASED_RECOGNITION"
></a>
...
@@ -339,7 +342,12 @@ For angle classification model inference, you can execute the following commands
...
@@ -339,7 +342,12 @@ For angle classification model inference, you can execute the following commands
```
```
python3 tools/infer/predict_cls.py --image_dir="./doc/imgs_words_en/word_10.png" --cls_model_dir="./inference/cls/"
python3 tools/infer/predict_cls.py --image_dir="./doc/imgs_words_en/word_10.png" --cls_model_dir="./inference/cls/"
```
```
```
# download text angle class inference model:
wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar
tar xf ch_ppocr_mobile_v2.0_cls_infer.tar
python3 tools/infer/predict_cls.py --image_dir="./doc/imgs_words_en/word_10.png" --cls_model_dir="ch_ppocr_mobile_v2.0_cls_infer"
```
![](
../imgs_words_en/word_10.png
)
![](
../imgs_words_en/word_10.png
)
After executing the command, the prediction results (classification angle and score) of the above image will be printed on the screen.
After executing the command, the prediction results (classification angle and score) of the above image will be printed on the screen.
...
...
doc/doc_en/recognition_en.md
浏览文件 @
7bd93832
...
@@ -317,11 +317,11 @@ Eval:
...
@@ -317,11 +317,11 @@ Eval:
<a
name=
"EVALUATION"
></a>
<a
name=
"EVALUATION"
></a>
### EVALUATION
### EVALUATION
The evaluation data
set can be modified via
`configs/rec/rec_icdar15_reader.yml`
setting of
`label_file_path`
in EvalReader
.
The evaluation data
set can be set by modifying the
`Eval.dataset.label_file_list`
field in the
`configs/rec/rec_icdar15_train.yml`
file
.
```
```
# GPU evaluation, Global.checkpoints is the weight to be tested
# GPU evaluation, Global.checkpoints is the weight to be tested
python3 -m paddle.distributed.launch --gpus '0' tools/eval.py -c configs/rec/rec_icdar15_
reader
.yml -o Global.checkpoints={path/to/weights}/best_accuracy
python3 -m paddle.distributed.launch --gpus '0' tools/eval.py -c configs/rec/rec_icdar15_
train
.yml -o Global.checkpoints={path/to/weights}/best_accuracy
```
```
<a
name=
"PREDICTION"
></a>
<a
name=
"PREDICTION"
></a>
...
@@ -336,7 +336,7 @@ The default prediction picture is stored in `infer_img`, and the weight is speci
...
@@ -336,7 +336,7 @@ The default prediction picture is stored in `infer_img`, and the weight is speci
```
```
# Predict English results
# Predict English results
python3 tools/infer_rec.py -c configs/rec/ch_ppocr_v2.0/rec_chinese_lite_train_v2.0.yml -o Global.
checkpoints={path/to/weights}/best_accuracy TestReader
.infer_img=doc/imgs_words/en/word_1.jpg
python3 tools/infer_rec.py -c configs/rec/ch_ppocr_v2.0/rec_chinese_lite_train_v2.0.yml -o Global.
pretrained_model={path/to/weights}/best_accuracy Global.load_static_weights=false Global
.infer_img=doc/imgs_words/en/word_1.jpg
```
```
Input image:
Input image:
...
@@ -354,7 +354,7 @@ The configuration file used for prediction must be consistent with the training.
...
@@ -354,7 +354,7 @@ The configuration file used for prediction must be consistent with the training.
```
```
# Predict Chinese results
# Predict Chinese results
python3 tools/infer_rec.py -c configs/rec/ch_ppocr_v2.0/rec_chinese_lite_train_v2.0.yml -o Global.
checkpoints={path/to/weights}/best_accuracy TestReader
.infer_img=doc/imgs_words/ch/word_1.jpg
python3 tools/infer_rec.py -c configs/rec/ch_ppocr_v2.0/rec_chinese_lite_train_v2.0.yml -o Global.
pretrained_model={path/to/weights}/best_accuracy Global.load_static_weights=false Global
.infer_img=doc/imgs_words/ch/word_1.jpg
```
```
Input image:
Input image:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录