Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_41840029
PaddleOCR
提交
52c9f16e
P
PaddleOCR
项目概览
weixin_41840029
/
PaddleOCR
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleOCR
通知
1
Star
1
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看板
提交
52c9f16e
编写于
9月 17, 2021
作者:
M
MissPenguin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add result comparison for det cpp_infer
上级
988afe1a
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
120 addition
and
5 deletion
+120
-5
deploy/cpp_infer/src/main.cpp
deploy/cpp_infer/src/main.cpp
+11
-1
tests/compare_results.py
tests/compare_results.py
+9
-4
tests/results/det_results_gpu_trt_fp16_cpp.txt
tests/results/det_results_gpu_trt_fp16_cpp.txt
+50
-0
tests/results/det_results_gpu_trt_fp32_cpp.txt
tests/results/det_results_gpu_trt_fp32_cpp.txt
+50
-0
未找到文件。
deploy/cpp_infer/src/main.cpp
浏览文件 @
52c9f16e
...
@@ -91,7 +91,7 @@ int main_det(std::vector<cv::String> cv_all_img_names) {
...
@@ -91,7 +91,7 @@ int main_det(std::vector<cv::String> cv_all_img_names) {
FLAGS_use_tensorrt
,
FLAGS_precision
);
FLAGS_use_tensorrt
,
FLAGS_precision
);
for
(
int
i
=
0
;
i
<
cv_all_img_names
.
size
();
++
i
)
{
for
(
int
i
=
0
;
i
<
cv_all_img_names
.
size
();
++
i
)
{
LOG
(
INFO
)
<<
"The predict img: "
<<
cv_all_img_names
[
i
];
//
LOG(INFO) << "The predict img: " << cv_all_img_names[i];
cv
::
Mat
srcimg
=
cv
::
imread
(
cv_all_img_names
[
i
],
cv
::
IMREAD_COLOR
);
cv
::
Mat
srcimg
=
cv
::
imread
(
cv_all_img_names
[
i
],
cv
::
IMREAD_COLOR
);
if
(
!
srcimg
.
data
)
{
if
(
!
srcimg
.
data
)
{
...
@@ -106,6 +106,16 @@ int main_det(std::vector<cv::String> cv_all_img_names) {
...
@@ -106,6 +106,16 @@ int main_det(std::vector<cv::String> cv_all_img_names) {
time_info
[
0
]
+=
det_times
[
0
];
time_info
[
0
]
+=
det_times
[
0
];
time_info
[
1
]
+=
det_times
[
1
];
time_info
[
1
]
+=
det_times
[
1
];
time_info
[
2
]
+=
det_times
[
2
];
time_info
[
2
]
+=
det_times
[
2
];
if
(
FLAGS_benchmark
)
{
cout
<<
cv_all_img_names
[
i
]
<<
'\t'
;
for
(
int
n
=
0
;
n
<
boxes
.
size
();
n
++
)
{
for
(
int
m
=
0
;
m
<
boxes
[
n
].
size
();
m
++
)
{
cout
<<
boxes
[
n
][
m
][
0
]
<<
' '
<<
boxes
[
n
][
m
][
1
]
<<
' '
;
}
}
cout
<<
endl
;
}
}
}
if
(
FLAGS_benchmark
)
{
if
(
FLAGS_benchmark
)
{
...
...
tests/compare_results.py
浏览文件 @
52c9f16e
...
@@ -32,7 +32,6 @@ def run_shell_command(cmd):
...
@@ -32,7 +32,6 @@ def run_shell_command(cmd):
else
:
else
:
return
None
return
None
def
parser_results_from_log_by_name
(
log_path
,
names_list
):
def
parser_results_from_log_by_name
(
log_path
,
names_list
):
if
not
os
.
path
.
exists
(
log_path
):
if
not
os
.
path
.
exists
(
log_path
):
raise
ValueError
(
"The log file {} does not exists!"
.
format
(
log_path
))
raise
ValueError
(
"The log file {} does not exists!"
.
format
(
log_path
))
...
@@ -46,11 +45,13 @@ def parser_results_from_log_by_name(log_path, names_list):
...
@@ -46,11 +45,13 @@ def parser_results_from_log_by_name(log_path, names_list):
outs
=
run_shell_command
(
cmd
)
outs
=
run_shell_command
(
cmd
)
outs
=
outs
.
split
(
"
\n
"
)[
0
]
outs
=
outs
.
split
(
"
\n
"
)[
0
]
result
=
outs
.
split
(
"{}"
.
format
(
name
))[
-
1
]
result
=
outs
.
split
(
"{}"
.
format
(
name
))[
-
1
]
result
=
json
.
loads
(
result
)
try
:
result
=
json
.
loads
(
result
)
except
:
result
=
np
.
array
([
int
(
r
)
for
r
in
result
.
split
()]).
reshape
(
-
1
,
4
)
parser_results
[
name
]
=
result
parser_results
[
name
]
=
result
return
parser_results
return
parser_results
def
load_gt_from_file
(
gt_file
):
def
load_gt_from_file
(
gt_file
):
if
not
os
.
path
.
exists
(
gt_file
):
if
not
os
.
path
.
exists
(
gt_file
):
raise
ValueError
(
"The log file {} does not exists!"
.
format
(
gt_file
))
raise
ValueError
(
"The log file {} does not exists!"
.
format
(
gt_file
))
...
@@ -60,7 +61,11 @@ def load_gt_from_file(gt_file):
...
@@ -60,7 +61,11 @@ def load_gt_from_file(gt_file):
parser_gt
=
{}
parser_gt
=
{}
for
line
in
data
:
for
line
in
data
:
image_name
,
result
=
line
.
strip
(
"
\n
"
).
split
(
"
\t
"
)
image_name
,
result
=
line
.
strip
(
"
\n
"
).
split
(
"
\t
"
)
result
=
json
.
loads
(
result
)
image_name
=
image_name
.
split
(
'/'
)[
-
1
]
try
:
result
=
json
.
loads
(
result
)
except
:
result
=
np
.
array
([
int
(
r
)
for
r
in
result
.
split
()]).
reshape
(
-
1
,
4
)
parser_gt
[
image_name
]
=
result
parser_gt
[
image_name
]
=
result
return
parser_gt
return
parser_gt
...
...
tests/results/det_results_gpu_trt_fp16_cpp.txt
0 → 100644
浏览文件 @
52c9f16e
此差异已折叠。
点击以展开。
tests/results/det_results_gpu_trt_fp32_cpp.txt
0 → 100644
浏览文件 @
52c9f16e
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录