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
a804a97c
Commit
a804a97c
authored
Dec 02, 2020
by
WenmuZhou
Browse files
add drop_score to args
parent
e696c790
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
tools/infer/utility.py
tools/infer/utility.py
+5
-4
No files found.
tools/infer/utility.py
View file @
a804a97c
...
@@ -71,6 +71,7 @@ def parse_args():
...
@@ -71,6 +71,7 @@ def parse_args():
parser
.
add_argument
(
"--use_space_char"
,
type
=
str2bool
,
default
=
True
)
parser
.
add_argument
(
"--use_space_char"
,
type
=
str2bool
,
default
=
True
)
parser
.
add_argument
(
parser
.
add_argument
(
"--vis_font_path"
,
type
=
str
,
default
=
"./doc/simfang.ttf"
)
"--vis_font_path"
,
type
=
str
,
default
=
"./doc/simfang.ttf"
)
parser
.
add_argument
(
"--drop_score"
,
type
=
float
,
default
=
0.5
)
# params for text classifier
# params for text classifier
parser
.
add_argument
(
"--use_angle_cls"
,
type
=
str2bool
,
default
=
False
)
parser
.
add_argument
(
"--use_angle_cls"
,
type
=
str2bool
,
default
=
False
)
...
@@ -229,10 +230,10 @@ def draw_ocr_box_txt(image,
...
@@ -229,10 +230,10 @@ def draw_ocr_box_txt(image,
box
[
2
][
1
],
box
[
3
][
0
],
box
[
3
][
1
]
box
[
2
][
1
],
box
[
3
][
0
],
box
[
3
][
1
]
],
],
outline
=
color
)
outline
=
color
)
box_height
=
math
.
sqrt
((
box
[
0
][
0
]
-
box
[
3
][
0
])
**
2
+
(
box
[
0
][
1
]
-
box
[
3
][
box_height
=
math
.
sqrt
((
box
[
0
][
0
]
-
box
[
3
][
0
])
**
2
+
(
box
[
0
][
1
]
-
box
[
3
][
1
])
**
2
)
1
])
**
2
)
box_width
=
math
.
sqrt
((
box
[
0
][
0
]
-
box
[
1
][
0
])
**
2
+
(
box
[
0
][
1
]
-
box
[
1
][
box_width
=
math
.
sqrt
((
box
[
0
][
0
]
-
box
[
1
][
0
])
**
2
+
(
box
[
0
][
1
]
-
box
[
1
][
1
])
**
2
)
1
])
**
2
)
if
box_height
>
2
*
box_width
:
if
box_height
>
2
*
box_width
:
font_size
=
max
(
int
(
box_width
*
0.9
),
10
)
font_size
=
max
(
int
(
box_width
*
0.9
),
10
)
font
=
ImageFont
.
truetype
(
font_path
,
font_size
,
encoding
=
"utf-8"
)
font
=
ImageFont
.
truetype
(
font_path
,
font_size
,
encoding
=
"utf-8"
)
...
...
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