Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
paddle_dbnet
Commits
a5b17bac
Unverified
Commit
a5b17bac
authored
Apr 16, 2021
by
zhoujun
Committed by
GitHub
Apr 16, 2021
Browse files
Merge branch 'dygraph' into fix_starnet
parents
2a9da251
713ceb4e
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
5 deletions
+6
-5
ppocr/utils/e2e_metric/Deteval.py
ppocr/utils/e2e_metric/Deteval.py
+1
-1
ppocr/utils/e2e_utils/extract_textpoint_fast.py
ppocr/utils/e2e_utils/extract_textpoint_fast.py
+1
-0
ppocr/utils/e2e_utils/pgnet_pp_utils.py
ppocr/utils/e2e_utils/pgnet_pp_utils.py
+2
-2
tools/infer/predict_e2e.py
tools/infer/predict_e2e.py
+1
-1
tools/infer_e2e.py
tools/infer_e2e.py
+1
-1
No files found.
ppocr/utils/e2e_metric/Deteval.py
View file @
a5b17bac
...
@@ -26,7 +26,7 @@ def get_socre(gt_dir, img_id, pred_dict):
...
@@ -26,7 +26,7 @@ def get_socre(gt_dir, img_id, pred_dict):
n
=
len
(
pred_dict
)
n
=
len
(
pred_dict
)
for
i
in
range
(
n
):
for
i
in
range
(
n
):
points
=
pred_dict
[
i
][
'points'
]
points
=
pred_dict
[
i
][
'points'
]
text
=
pred_dict
[
i
][
'text'
]
text
=
pred_dict
[
i
][
'text
s
'
]
point
=
","
.
join
(
map
(
str
,
points
.
reshape
(
-
1
,
)))
point
=
","
.
join
(
map
(
str
,
points
.
reshape
(
-
1
,
)))
det
.
append
([
point
,
text
])
det
.
append
([
point
,
text
])
return
det
return
det
...
...
ppocr/utils/e2e_utils/extract_textpoint_fast.py
View file @
a5b17bac
...
@@ -21,6 +21,7 @@ import math
...
@@ -21,6 +21,7 @@ import math
import
numpy
as
np
import
numpy
as
np
from
itertools
import
groupby
from
itertools
import
groupby
from
cv2.ximgproc
import
thinning
as
thin
from
skimage.morphology._skeletonize
import
thin
from
skimage.morphology._skeletonize
import
thin
...
...
ppocr/utils/e2e_utils/pgnet_pp_utils.py
View file @
a5b17bac
...
@@ -64,7 +64,7 @@ class PGNet_PostProcess(object):
...
@@ -64,7 +64,7 @@ class PGNet_PostProcess(object):
src_w
,
src_h
,
self
.
valid_set
)
src_w
,
src_h
,
self
.
valid_set
)
data
=
{
data
=
{
'points'
:
poly_list
,
'points'
:
poly_list
,
'
str
s'
:
keep_str_list
,
'
text
s'
:
keep_str_list
,
}
}
return
data
return
data
...
@@ -176,6 +176,6 @@ class PGNet_PostProcess(object):
...
@@ -176,6 +176,6 @@ class PGNet_PostProcess(object):
exit
(
-
1
)
exit
(
-
1
)
data
=
{
data
=
{
'points'
:
poly_list
,
'points'
:
poly_list
,
'
str
s'
:
keep_str_list
,
'
text
s'
:
keep_str_list
,
}
}
return
data
return
data
tools/infer/predict_e2e.py
View file @
a5b17bac
...
@@ -122,7 +122,7 @@ class TextE2E(object):
...
@@ -122,7 +122,7 @@ class TextE2E(object):
else
:
else
:
raise
NotImplementedError
raise
NotImplementedError
post_result
=
self
.
postprocess_op
(
preds
,
shape_list
)
post_result
=
self
.
postprocess_op
(
preds
,
shape_list
)
points
,
strs
=
post_result
[
'points'
],
post_result
[
'
str
s'
]
points
,
strs
=
post_result
[
'points'
],
post_result
[
'
text
s'
]
dt_boxes
=
self
.
filter_tag_det_res_only_clip
(
points
,
ori_im
.
shape
)
dt_boxes
=
self
.
filter_tag_det_res_only_clip
(
points
,
ori_im
.
shape
)
elapse
=
time
.
time
()
-
starttime
elapse
=
time
.
time
()
-
starttime
return
dt_boxes
,
strs
,
elapse
return
dt_boxes
,
strs
,
elapse
...
...
tools/infer_e2e.py
View file @
a5b17bac
...
@@ -103,7 +103,7 @@ def main():
...
@@ -103,7 +103,7 @@ def main():
images
=
paddle
.
to_tensor
(
images
)
images
=
paddle
.
to_tensor
(
images
)
preds
=
model
(
images
)
preds
=
model
(
images
)
post_result
=
post_process_class
(
preds
,
shape_list
)
post_result
=
post_process_class
(
preds
,
shape_list
)
points
,
strs
=
post_result
[
'points'
],
post_result
[
'
str
s'
]
points
,
strs
=
post_result
[
'points'
],
post_result
[
'
text
s'
]
# write resule
# write resule
dt_boxes_json
=
[]
dt_boxes_json
=
[]
for
poly
,
str
in
zip
(
points
,
strs
):
for
poly
,
str
in
zip
(
points
,
strs
):
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment