Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleOCR
提交
fdad3d4d
P
PaddleOCR
项目概览
PaddlePaddle
/
PaddleOCR
大约 1 年 前同步成功
通知
1528
Star
32962
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看板
提交
fdad3d4d
编写于
5月 20, 2020
作者:
L
LDOUBLEV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
single_img_path to infer_img as rec model, fix eval Hmean=0
上级
0d16606e
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
10 addition
and
9 deletion
+10
-9
configs/det/det_db_icdar15_reader.yml
configs/det/det_db_icdar15_reader.yml
+1
-1
configs/det/det_east_icdar15_reader.yml
configs/det/det_east_icdar15_reader.yml
+1
-1
configs/rec/rec_benchmark_reader.yml
configs/rec/rec_benchmark_reader.yml
+2
-1
doc/detection.md
doc/detection.md
+2
-2
ppocr/data/det/dataset_traversal.py
ppocr/data/det/dataset_traversal.py
+1
-1
tools/eval.py
tools/eval.py
+1
-0
tools/eval_utils/eval_det_utils.py
tools/eval_utils/eval_det_utils.py
+1
-1
tools/infer_det.py
tools/infer_det.py
+1
-2
未找到文件。
configs/det/det_db_icdar15_reader.yml
浏览文件 @
fdad3d4d
...
@@ -15,7 +15,7 @@ EvalReader:
...
@@ -15,7 +15,7 @@ EvalReader:
TestReader
:
TestReader
:
reader_function
:
ppocr.data.det.dataset_traversal,EvalTestReader
reader_function
:
ppocr.data.det.dataset_traversal,EvalTestReader
process_function
:
ppocr.data.det.db_process,DBProcessTest
process_function
:
ppocr.data.det.db_process,DBProcessTest
single_img_path
:
infer_img
:
img_set_dir
:
./train_data/icdar2015/text_localization/
img_set_dir
:
./train_data/icdar2015/text_localization/
label_file_path
:
./train_data/icdar2015/text_localization/test_icdar2015_label.txt
label_file_path
:
./train_data/icdar2015/text_localization/test_icdar2015_label.txt
test_image_shape
:
[
736
,
1280
]
test_image_shape
:
[
736
,
1280
]
...
...
configs/det/det_east_icdar15_reader.yml
浏览文件 @
fdad3d4d
...
@@ -17,7 +17,7 @@ EvalReader:
...
@@ -17,7 +17,7 @@ EvalReader:
TestReader
:
TestReader
:
reader_function
:
ppocr.data.det.dataset_traversal,EvalTestReader
reader_function
:
ppocr.data.det.dataset_traversal,EvalTestReader
process_function
:
ppocr.data.det.east_process,EASTProcessTest
process_function
:
ppocr.data.det.east_process,EASTProcessTest
single_img_path
:
infer_img
:
img_set_dir
:
./train_data/icdar2015/text_localization/
img_set_dir
:
./train_data/icdar2015/text_localization/
label_file_path
:
./train_data/icdar2015/text_localization/test_icdar2015_label.txt
label_file_path
:
./train_data/icdar2015/text_localization/test_icdar2015_label.txt
do_eval
:
True
do_eval
:
True
configs/rec/rec_benchmark_reader.yml
浏览文件 @
fdad3d4d
...
@@ -9,4 +9,5 @@ EvalReader:
...
@@ -9,4 +9,5 @@ EvalReader:
TestReader
:
TestReader
:
reader_function
:
ppocr.data.rec.dataset_traversal,LMDBReader
reader_function
:
ppocr.data.rec.dataset_traversal,LMDBReader
lmdb_sets_dir
:
./train_data/data_lmdb_release/evaluation/
lmdb_sets_dir
:
./train_data/data_lmdb_release/evaluation/
\ No newline at end of file
infer_img
:
./infer_img
\ No newline at end of file
doc/detection.md
浏览文件 @
fdad3d4d
...
@@ -79,10 +79,10 @@ python3 tools/eval.py -c configs/det/det_mv3_db.yml -o Global.checkpoints="./ou
...
@@ -79,10 +79,10 @@ python3 tools/eval.py -c configs/det/det_mv3_db.yml -o Global.checkpoints="./ou
测试单张图像的检测效果
测试单张图像的检测效果
```
```
python3 tools/infer_det.py -c configs/det/det_mv3_db.yml -o TestReader.
single_img_path
="./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 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.yml -o TestReader.
single_img_path
="./doc/imgs_en/" Global.checkpoints="./output/det_db/best_accuracy"
python3 tools/infer_det.py -c configs/det/det_mv3_db.yml -o TestReader.
infer_img
="./doc/imgs_en/" Global.checkpoints="./output/det_db/best_accuracy"
```
```
ppocr/data/det/dataset_traversal.py
浏览文件 @
fdad3d4d
...
@@ -84,7 +84,7 @@ class EvalTestReader(object):
...
@@ -84,7 +84,7 @@ class EvalTestReader(object):
img_path
=
os
.
path
.
join
(
img_set_dir
,
img_name
)
img_path
=
os
.
path
.
join
(
img_set_dir
,
img_name
)
img_list
.
append
(
img_path
)
img_list
.
append
(
img_path
)
else
:
else
:
img_path
=
self
.
params
[
'
single_img_path
'
]
img_path
=
self
.
params
[
'
infer_img
'
]
img_list
=
get_image_file_list
(
img_path
)
img_list
=
get_image_file_list
(
img_path
)
def
batch_iter_reader
():
def
batch_iter_reader
():
...
...
tools/eval.py
浏览文件 @
fdad3d4d
...
@@ -78,6 +78,7 @@ def main():
...
@@ -78,6 +78,7 @@ def main():
'fetch_name_list'
:
eval_fetch_name_list
,
\
'fetch_name_list'
:
eval_fetch_name_list
,
\
'fetch_varname_list'
:
eval_fetch_varname_list
}
'fetch_varname_list'
:
eval_fetch_varname_list
}
metrics
=
eval_det_run
(
exe
,
config
,
eval_info_dict
,
"eval"
)
metrics
=
eval_det_run
(
exe
,
config
,
eval_info_dict
,
"eval"
)
print
(
"Eval result"
,
metrics
)
else
:
else
:
reader_type
=
config
[
'Global'
][
'reader_yml'
]
reader_type
=
config
[
'Global'
][
'reader_yml'
]
if
"benchmark"
not
in
reader_type
:
if
"benchmark"
not
in
reader_type
:
...
...
tools/eval_utils/eval_det_utils.py
浏览文件 @
fdad3d4d
...
@@ -96,7 +96,7 @@ def load_label_infor(label_file_path, do_ignore=False):
...
@@ -96,7 +96,7 @@ def load_label_infor(label_file_path, do_ignore=False):
if
text
==
"###"
and
do_ignore
:
if
text
==
"###"
and
do_ignore
:
ignore
=
True
ignore
=
True
bbox_infor
[
bno
][
'ignore'
]
=
ignore
bbox_infor
[
bno
][
'ignore'
]
=
ignore
img_name_label_dict
[
substr
[
0
]
]
=
bbox_infor
img_name_label_dict
[
os
.
path
.
basename
(
substr
[
0
])
]
=
bbox_infor
return
img_name_label_dict
return
img_name_label_dict
...
...
tools/infer_det.py
浏览文件 @
fdad3d4d
...
@@ -106,7 +106,6 @@ def main():
...
@@ -106,7 +106,6 @@ def main():
with
open
(
save_res_path
,
"wb"
)
as
fout
:
with
open
(
save_res_path
,
"wb"
)
as
fout
:
test_reader
=
reader_main
(
config
=
config
,
mode
=
'test'
)
test_reader
=
reader_main
(
config
=
config
,
mode
=
'test'
)
# image_file_list = get_image_file_list(args.image_dir)
tackling_num
=
0
tackling_num
=
0
for
data
in
test_reader
():
for
data
in
test_reader
():
img_num
=
len
(
data
)
img_num
=
len
(
data
)
...
@@ -135,7 +134,7 @@ def main():
...
@@ -135,7 +134,7 @@ def main():
elif
config
[
'Global'
][
'algorithm'
]
==
'DB'
:
elif
config
[
'Global'
][
'algorithm'
]
==
'DB'
:
dic
=
{
'maps'
:
outs
[
0
]}
dic
=
{
'maps'
:
outs
[
0
]}
else
:
else
:
raise
Exception
(
"only support algorithm: ['EAST', '
BD
']"
)
raise
Exception
(
"only support algorithm: ['EAST', '
DB
']"
)
dt_boxes_list
=
postprocess
(
dic
,
ratio_list
)
dt_boxes_list
=
postprocess
(
dic
,
ratio_list
)
for
ino
in
range
(
img_num
):
for
ino
in
range
(
img_num
):
dt_boxes
=
dt_boxes_list
[
ino
]
dt_boxes
=
dt_boxes_list
[
ino
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录