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
52671b7d
Unverified
Commit
52671b7d
authored
Dec 13, 2020
by
MissPenguin
Committed by
GitHub
Dec 13, 2020
Browse files
Merge pull request #1402 from MissPenguin/dygraph
fix predict_det
parents
d7f53651
edc0fd0c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
ppocr/postprocess/db_postprocess.py
ppocr/postprocess/db_postprocess.py
+1
-1
tools/infer/predict_det.py
tools/infer/predict_det.py
+2
-1
No files found.
ppocr/postprocess/db_postprocess.py
100644 → 100755
View file @
52671b7d
...
@@ -40,7 +40,7 @@ class DBPostProcess(object):
...
@@ -40,7 +40,7 @@ class DBPostProcess(object):
self
.
max_candidates
=
max_candidates
self
.
max_candidates
=
max_candidates
self
.
unclip_ratio
=
unclip_ratio
self
.
unclip_ratio
=
unclip_ratio
self
.
min_size
=
3
self
.
min_size
=
3
self
.
dilation_kernel
=
None
if
not
use_dilation
else
[[
1
,
1
],
[
1
,
1
]]
self
.
dilation_kernel
=
None
if
not
use_dilation
else
np
.
array
(
[[
1
,
1
],
[
1
,
1
]]
)
def
boxes_from_bitmap
(
self
,
pred
,
_bitmap
,
dest_width
,
dest_height
):
def
boxes_from_bitmap
(
self
,
pred
,
_bitmap
,
dest_width
,
dest_height
):
'''
'''
...
...
tools/infer/predict_det.py
View file @
52671b7d
...
@@ -63,6 +63,7 @@ class TextDetector(object):
...
@@ -63,6 +63,7 @@ class TextDetector(object):
postprocess_params
[
"box_thresh"
]
=
args
.
det_db_box_thresh
postprocess_params
[
"box_thresh"
]
=
args
.
det_db_box_thresh
postprocess_params
[
"max_candidates"
]
=
1000
postprocess_params
[
"max_candidates"
]
=
1000
postprocess_params
[
"unclip_ratio"
]
=
args
.
det_db_unclip_ratio
postprocess_params
[
"unclip_ratio"
]
=
args
.
det_db_unclip_ratio
postprocess_params
[
"use_dilation"
]
=
True
else
:
else
:
logger
.
info
(
"unknown det_algorithm:{}"
.
format
(
self
.
det_algorithm
))
logger
.
info
(
"unknown det_algorithm:{}"
.
format
(
self
.
det_algorithm
))
sys
.
exit
(
0
)
sys
.
exit
(
0
)
...
@@ -111,7 +112,7 @@ class TextDetector(object):
...
@@ -111,7 +112,7 @@ class TextDetector(object):
box
=
self
.
clip_det_res
(
box
,
img_height
,
img_width
)
box
=
self
.
clip_det_res
(
box
,
img_height
,
img_width
)
rect_width
=
int
(
np
.
linalg
.
norm
(
box
[
0
]
-
box
[
1
]))
rect_width
=
int
(
np
.
linalg
.
norm
(
box
[
0
]
-
box
[
1
]))
rect_height
=
int
(
np
.
linalg
.
norm
(
box
[
0
]
-
box
[
3
]))
rect_height
=
int
(
np
.
linalg
.
norm
(
box
[
0
]
-
box
[
3
]))
if
rect_width
<=
10
or
rect_height
<=
10
:
if
rect_width
<=
3
or
rect_height
<=
3
:
continue
continue
dt_boxes_new
.
append
(
box
)
dt_boxes_new
.
append
(
box
)
dt_boxes
=
np
.
array
(
dt_boxes_new
)
dt_boxes
=
np
.
array
(
dt_boxes_new
)
...
...
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