Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleOCR
提交
c4d20782
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看板
未验证
提交
c4d20782
编写于
4月 30, 2021
作者:
M
MissPenguin
提交者:
GitHub
4月 30, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2690 from littletomatodonkey/dyg/cp_user_pr
cherry-pick users' pr
上级
90bede2b
d5651dfa
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
13 addition
and
4 deletion
+13
-4
deploy/cpp_infer/src/postprocess_op.cpp
deploy/cpp_infer/src/postprocess_op.cpp
+8
-3
tools/program.py
tools/program.py
+5
-1
未找到文件。
deploy/cpp_infer/src/postprocess_op.cpp
浏览文件 @
c4d20782
...
@@ -186,18 +186,23 @@ float PostProcessor::PolygonScoreAcc(std::vector<cv::Point> contour,
...
@@ -186,18 +186,23 @@ float PostProcessor::PolygonScoreAcc(std::vector<cv::Point> contour,
cv
::
Mat
mask
;
cv
::
Mat
mask
;
mask
=
cv
::
Mat
::
zeros
(
ymax
-
ymin
+
1
,
xmax
-
xmin
+
1
,
CV_8UC1
);
mask
=
cv
::
Mat
::
zeros
(
ymax
-
ymin
+
1
,
xmax
-
xmin
+
1
,
CV_8UC1
);
cv
::
Point
rook_point
[
contour
.
size
()];
cv
::
Point
*
rook_point
=
new
cv
::
Point
[
contour
.
size
()];
for
(
int
i
=
0
;
i
<
contour
.
size
();
++
i
)
{
for
(
int
i
=
0
;
i
<
contour
.
size
();
++
i
)
{
rook_point
[
i
]
=
cv
::
Point
(
int
(
box_x
[
i
])
-
xmin
,
int
(
box_y
[
i
])
-
ymin
);
rook_point
[
i
]
=
cv
::
Point
(
int
(
box_x
[
i
])
-
xmin
,
int
(
box_y
[
i
])
-
ymin
);
}
}
const
cv
::
Point
*
ppt
[
1
]
=
{
rook_point
};
const
cv
::
Point
*
ppt
[
1
]
=
{
rook_point
};
int
npt
[]
=
{
int
(
contour
.
size
())};
int
npt
[]
=
{
int
(
contour
.
size
())};
cv
::
fillPoly
(
mask
,
ppt
,
npt
,
1
,
cv
::
Scalar
(
1
));
cv
::
fillPoly
(
mask
,
ppt
,
npt
,
1
,
cv
::
Scalar
(
1
));
cv
::
Mat
croppedImg
;
cv
::
Mat
croppedImg
;
pred
(
cv
::
Rect
(
xmin
,
ymin
,
xmax
-
xmin
+
1
,
ymax
-
ymin
+
1
))
pred
(
cv
::
Rect
(
xmin
,
ymin
,
xmax
-
xmin
+
1
,
ymax
-
ymin
+
1
)).
copyTo
(
croppedImg
);
.
copyTo
(
croppedImg
);
float
score
=
cv
::
mean
(
croppedImg
,
mask
)[
0
];
float
score
=
cv
::
mean
(
croppedImg
,
mask
)[
0
];
delete
[]
rook_point
;
return
score
;
return
score
;
}
}
...
...
tools/program.py
浏览文件 @
c4d20782
...
@@ -199,8 +199,12 @@ def train(config,
...
@@ -199,8 +199,12 @@ def train(config,
train_reader_cost
=
0.0
train_reader_cost
=
0.0
batch_sum
=
0
batch_sum
=
0
batch_start
=
time
.
time
()
batch_start
=
time
.
time
()
for
idx
,
batch
in
enumerate
(
train_dataloader
()):
max_iter
=
len
(
train_dataloader
)
-
1
if
platform
.
system
(
)
==
"Windows"
else
len
(
train_dataloader
)
for
idx
,
batch
in
enumerate
(
train_dataloader
):
train_reader_cost
+=
time
.
time
()
-
batch_start
train_reader_cost
+=
time
.
time
()
-
batch_start
if
idx
>=
max_iter
:
break
lr
=
optimizer
.
get_lr
()
lr
=
optimizer
.
get_lr
()
images
=
batch
[
0
]
images
=
batch
[
0
]
if
use_srn
:
if
use_srn
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录