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
389e315a
Commit
389e315a
authored
Nov 29, 2021
by
WenmuZhou
Browse files
opt east post
parent
2c003d56
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
ppocr/postprocess/east_postprocess.py
ppocr/postprocess/east_postprocess.py
+9
-7
No files found.
ppocr/postprocess/east_postprocess.py
View file @
389e315a
...
@@ -60,11 +60,6 @@ class EASTPostProcess(object):
...
@@ -60,11 +60,6 @@ class EASTPostProcess(object):
"""
"""
restore text boxes from score map and geo map
restore text boxes from score map and geo map
"""
"""
try
:
import
lanms
except
:
raise
Exception
(
'you should install lanms by pip3 install lanms-nova'
)
score_map
=
score_map
[
0
]
score_map
=
score_map
[
0
]
geo_map
=
np
.
swapaxes
(
geo_map
,
1
,
0
)
geo_map
=
np
.
swapaxes
(
geo_map
,
1
,
0
)
...
@@ -81,8 +76,15 @@ class EASTPostProcess(object):
...
@@ -81,8 +76,15 @@ class EASTPostProcess(object):
boxes
=
np
.
zeros
((
text_box_restored
.
shape
[
0
],
9
),
dtype
=
np
.
float32
)
boxes
=
np
.
zeros
((
text_box_restored
.
shape
[
0
],
9
),
dtype
=
np
.
float32
)
boxes
[:,
:
8
]
=
text_box_restored
.
reshape
((
-
1
,
8
))
boxes
[:,
:
8
]
=
text_box_restored
.
reshape
((
-
1
,
8
))
boxes
[:,
8
]
=
score_map
[
xy_text
[:,
0
],
xy_text
[:,
1
]]
boxes
[:,
8
]
=
score_map
[
xy_text
[:,
0
],
xy_text
[:,
1
]]
boxes
=
lanms
.
merge_quadrangle_n9
(
boxes
,
nms_thresh
)
# boxes = nms_locality(boxes.astype(np.float64), nms_thresh)
try
:
import
lanms
boxes
=
lanms
.
merge_quadrangle_n9
(
boxes
,
nms_thresh
)
except
:
print
(
'you should install lanms by pip3 install lanms-nova to speed up nms_locality'
)
boxes
=
nms_locality
(
boxes
.
astype
(
np
.
float64
),
nms_thresh
)
if
boxes
.
shape
[
0
]
==
0
:
if
boxes
.
shape
[
0
]
==
0
:
return
[]
return
[]
# Here we filter some low score boxes by the average score map,
# Here we filter some low score boxes by the average score map,
...
...
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