Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleOCR
提交
ad7f65f7
P
PaddleOCR
项目概览
PaddlePaddle
/
PaddleOCR
1 年多 前同步成功
通知
1538
Star
32963
Fork
6643
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
108
列表
看板
标记
里程碑
合并请求
7
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
108
Issue
108
列表
看板
标记
里程碑
合并请求
7
合并请求
7
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
ad7f65f7
编写于
11月 09, 2020
作者:
D
Double_V
提交者:
GitHub
11月 09, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1113 from LDOUBLEV/fixocr
TestReader.infer_img to Global.infer_img
上级
3f7395bc
95567abe
变更
17
显示空白变更内容
内联
并排
Showing
17 changed file
with
33 addition
and
20 deletion
+33
-20
configs/det/det_db_icdar15_reader.yml
configs/det/det_db_icdar15_reader.yml
+0
-1
configs/det/det_east_icdar15_reader.yml
configs/det/det_east_icdar15_reader.yml
+0
-1
configs/det/det_mv3_db.yml
configs/det/det_mv3_db.yml
+1
-0
configs/det/det_mv3_db_v1.1.yml
configs/det/det_mv3_db_v1.1.yml
+1
-0
configs/det/det_mv3_east.yml
configs/det/det_mv3_east.yml
+1
-0
configs/det/det_r18_vd_db_v1.1.yml
configs/det/det_r18_vd_db_v1.1.yml
+1
-0
configs/det/det_r50_vd_db.yml
configs/det/det_r50_vd_db.yml
+1
-0
configs/det/det_r50_vd_east.yml
configs/det/det_r50_vd_east.yml
+1
-0
configs/det/det_r50_vd_sast_icdar15.yml
configs/det/det_r50_vd_sast_icdar15.yml
+1
-0
configs/det/det_r50_vd_sast_totaltext.yml
configs/det/det_r50_vd_sast_totaltext.yml
+1
-0
configs/det/det_sast_icdar15_reader.yml
configs/det/det_sast_icdar15_reader.yml
+0
-1
configs/det/det_sast_totaltext_reader.yml
configs/det/det_sast_totaltext_reader.yml
+0
-1
doc/doc_ch/detection.md
doc/doc_ch/detection.md
+5
-5
doc/doc_en/detection_en.md
doc/doc_en/detection_en.md
+4
-4
doc/doc_en/recognition_en.md
doc/doc_en/recognition_en.md
+2
-2
tools/infer_det.py
tools/infer_det.py
+10
-4
tools/program.py
tools/program.py
+4
-1
未找到文件。
configs/det/det_db_icdar15_reader.yml
浏览文件 @
ad7f65f7
...
...
@@ -15,7 +15,6 @@ EvalReader:
TestReader
:
reader_function
:
ppocr.data.det.dataset_traversal,EvalTestReader
process_function
:
ppocr.data.det.db_process,DBProcessTest
infer_img
:
img_set_dir
:
./train_data/icdar2015/text_localization/
label_file_path
:
./train_data/icdar2015/text_localization/test_icdar2015_label.txt
do_eval
:
True
configs/det/det_east_icdar15_reader.yml
浏览文件 @
ad7f65f7
...
...
@@ -17,7 +17,6 @@ EvalReader:
TestReader
:
reader_function
:
ppocr.data.det.dataset_traversal,EvalTestReader
process_function
:
ppocr.data.det.east_process,EASTProcessTest
infer_img
:
img_set_dir
:
./train_data/icdar2015/text_localization/
label_file_path
:
./train_data/icdar2015/text_localization/test_icdar2015_label.txt
do_eval
:
True
configs/det/det_mv3_db.yml
浏览文件 @
ad7f65f7
...
...
@@ -16,6 +16,7 @@ Global:
checkpoints
:
save_res_path
:
./output/det_db/predicts_db.txt
save_inference_dir
:
infer_img
:
Architecture
:
function
:
ppocr.modeling.architectures.det_model,DetModel
...
...
configs/det/det_mv3_db_v1.1.yml
浏览文件 @
ad7f65f7
...
...
@@ -16,6 +16,7 @@ Global:
checkpoints
:
save_res_path
:
./output/det_db/predicts_db.txt
save_inference_dir
:
infer_img
:
Architecture
:
function
:
ppocr.modeling.architectures.det_model,DetModel
...
...
configs/det/det_mv3_east.yml
浏览文件 @
ad7f65f7
...
...
@@ -15,6 +15,7 @@ Global:
checkpoints
:
save_res_path
:
./output/det_east/predicts_east.txt
save_inference_dir
:
infer_img
:
Architecture
:
function
:
ppocr.modeling.architectures.det_model,DetModel
...
...
configs/det/det_r18_vd_db_v1.1.yml
浏览文件 @
ad7f65f7
...
...
@@ -15,6 +15,7 @@ Global:
save_res_path
:
./output/det_r18_vd_db/predicts_db.txt
checkpoints
:
save_inference_dir
:
infer_img
:
Architecture
:
function
:
ppocr.modeling.architectures.det_model,DetModel
...
...
configs/det/det_r50_vd_db.yml
浏览文件 @
ad7f65f7
...
...
@@ -15,6 +15,7 @@ Global:
save_res_path
:
./output/det_db/predicts_db.txt
checkpoints
:
save_inference_dir
:
infer_img
:
Architecture
:
function
:
ppocr.modeling.architectures.det_model,DetModel
...
...
configs/det/det_r50_vd_east.yml
浏览文件 @
ad7f65f7
...
...
@@ -15,6 +15,7 @@ Global:
save_res_path
:
./output/det_east/predicts_east.txt
checkpoints
:
save_inference_dir
:
infer_img
:
Architecture
:
function
:
ppocr.modeling.architectures.det_model,DetModel
...
...
configs/det/det_r50_vd_sast_icdar15.yml
浏览文件 @
ad7f65f7
...
...
@@ -15,6 +15,7 @@ Global:
save_res_path
:
./output/det_sast/predicts_sast.txt
checkpoints
:
save_inference_dir
:
infer_img
:
Architecture
:
function
:
ppocr.modeling.architectures.det_model,DetModel
...
...
configs/det/det_r50_vd_sast_totaltext.yml
浏览文件 @
ad7f65f7
...
...
@@ -15,6 +15,7 @@ Global:
save_res_path
:
./output/det_sast/predicts_sast.txt
checkpoints
:
save_inference_dir
:
infer_img
:
Architecture
:
function
:
ppocr.modeling.architectures.det_model,DetModel
...
...
configs/det/det_sast_icdar15_reader.yml
浏览文件 @
ad7f65f7
...
...
@@ -20,5 +20,4 @@ EvalReader:
TestReader
:
reader_function
:
ppocr.data.det.dataset_traversal,EvalTestReader
process_function
:
ppocr.data.det.sast_process,SASTProcessTest
infer_img
:
./train_data/icdar2015/text_localization/ch4_test_images/img_11.jpg
max_side_len
:
1536
configs/det/det_sast_totaltext_reader.yml
浏览文件 @
ad7f65f7
...
...
@@ -20,5 +20,4 @@ EvalReader:
TestReader
:
reader_function
:
ppocr.data.det.dataset_traversal,EvalTestReader
process_function
:
ppocr.data.det.sast_process,SASTProcessTest
infer_img
:
./train_data/afs/total_text/Images/Test/img623.jpg
max_side_len
:
768
doc/doc_ch/detection.md
浏览文件 @
ad7f65f7
...
...
@@ -119,16 +119,16 @@ python3 tools/eval.py -c configs/det/det_mv3_db_v1.1.yml -o Global.checkpoints=
测试单张图像的检测效果
```
shell
python3 tools/infer_det.py
-c
configs/det/det_mv3_db_v1.1.yml
-o
TestReader
.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_v1.1.yml
-o
Global
.infer_img
=
"./doc/imgs_en/img_10.jpg"
Global.checkpoints
=
"./output/det_db/best_accuracy"
```
测试DB模型时,调整后处理阈值,
```
shell
python3 tools/infer_det.py
-c
configs/det/det_mv3_db_v1.1.yml
-o
TestReader
.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_v1.1.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
```
测试文件夹下所有图像的检测效果
```
shell
python3 tools/infer_det.py
-c
configs/det/det_mv3_db_v1.1.yml
-o
TestReader
.infer_img
=
"./doc/imgs_en/"
Global.checkpoints
=
"./output/det_db/best_accuracy"
python3 tools/infer_det.py
-c
configs/det/det_mv3_db_v1.1.yml
-o
Global
.infer_img
=
"./doc/imgs_en/"
Global.checkpoints
=
"./output/det_db/best_accuracy"
```
doc/doc_en/detection_en.md
浏览文件 @
ad7f65f7
...
...
@@ -110,16 +110,16 @@ python3 tools/eval.py -c configs/det/det_mv3_db_v1.1.yml -o Global.checkpoints=
Test the detection result on a single image:
```
shell
python3 tools/infer_det.py
-c
configs/det/det_mv3_db_v1.1.yml
-o
TestReader
.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_v1.1.yml
-o
Global
.infer_img
=
"./doc/imgs_en/img_10.jpg"
Global.checkpoints
=
"./output/det_db/best_accuracy"
```
When testing the DB model, adjust the post-processing threshold:
```
shell
python3 tools/infer_det.py
-c
configs/det/det_mv3_db_v1.1.yml
-o
TestReader
.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_v1.1.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
```
Test the detection result on all images in the folder:
```
shell
python3 tools/infer_det.py
-c
configs/det/det_mv3_db_v1.1.yml
-o
TestReader
.infer_img
=
"./doc/imgs_en/"
Global.checkpoints
=
"./output/det_db/best_accuracy"
python3 tools/infer_det.py
-c
configs/det/det_mv3_db_v1.1.yml
-o
Global
.infer_img
=
"./doc/imgs_en/"
Global.checkpoints
=
"./output/det_db/best_accuracy"
```
doc/doc_en/recognition_en.md
浏览文件 @
ad7f65f7
...
...
@@ -294,7 +294,7 @@ The default prediction picture is stored in `infer_img`, and the weight is speci
```
# Predict English results
python3 tools/infer_rec.py -c configs/rec/ch_ppocr_v1.1/rec_chinese_lite_train_v1.1.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_v1.1/rec_chinese_lite_train_v1.1.yml -o Global.checkpoints={path/to/weights}/best_accuracy
Global
.infer_img=doc/imgs_words/en/word_1.jpg
```
Input image:
...
...
@@ -313,7 +313,7 @@ The configuration file used for prediction must be consistent with the training.
```
# Predict Chinese results
python3 tools/infer_rec.py -c configs/rec/ch_ppocr_v1.1/rec_chinese_lite_train_v1.1.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_v1.1/rec_chinese_lite_train_v1.1.yml -o Global.checkpoints={path/to/weights}/best_accuracy
Global
.infer_img=doc/imgs_words/ch/word_1.jpg
```
Input image:
...
...
tools/infer_det.py
浏览文件 @
ad7f65f7
...
...
@@ -104,8 +104,8 @@ def main():
save_res_path
=
config
[
'Global'
][
'save_res_path'
]
if
not
os
.
path
.
exists
(
os
.
path
.
dirname
(
save_res_path
)):
os
.
makedirs
(
os
.
path
.
dirname
(
save_res_path
))
with
open
(
save_res_path
,
"wb"
)
as
fout
:
with
open
(
save_res_path
,
"wb"
)
as
fout
:
test_reader
=
reader_main
(
config
=
config
,
mode
=
'test'
)
tackling_num
=
0
for
data
in
test_reader
():
...
...
@@ -135,9 +135,15 @@ def main():
elif
config
[
'Global'
][
'algorithm'
]
==
'DB'
:
dic
=
{
'maps'
:
outs
[
0
]}
elif
config
[
'Global'
][
'algorithm'
]
==
'SAST'
:
dic
=
{
'f_score'
:
outs
[
0
],
'f_border'
:
outs
[
1
],
'f_tvo'
:
outs
[
2
],
'f_tco'
:
outs
[
3
]}
dic
=
{
'f_score'
:
outs
[
0
],
'f_border'
:
outs
[
1
],
'f_tvo'
:
outs
[
2
],
'f_tco'
:
outs
[
3
]
}
else
:
raise
Exception
(
"only support algorithm: ['EAST', 'DB', 'SAST']"
)
raise
Exception
(
"only support algorithm: ['EAST', 'DB', 'SAST']"
)
dt_boxes_list
=
postprocess
(
dic
,
ratio_list
)
for
ino
in
range
(
img_num
):
dt_boxes
=
dt_boxes_list
[
ino
]
...
...
tools/program.py
浏览文件 @
ad7f65f7
...
...
@@ -121,7 +121,10 @@ def merge_config(config):
global_config
.
keys
(),
sub_keys
[
0
])
cur
=
global_config
[
sub_keys
[
0
]]
for
idx
,
sub_key
in
enumerate
(
sub_keys
[
1
:]):
assert
(
sub_key
in
cur
)
assert
(
sub_key
in
cur
),
"key {} not in sub_keys: {}, please check your running command."
.
format
(
sub_key
,
cur
)
if
idx
==
len
(
sub_keys
)
-
2
:
cur
[
sub_key
]
=
value
else
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录