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
1de1f30a
Commit
1de1f30a
authored
Jun 09, 2021
by
LDOUBLEV
Browse files
add warmup
parent
2c2918f2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
0 deletions
+19
-0
tools/infer/predict_det.py
tools/infer/predict_det.py
+6
-0
tools/infer/predict_rec.py
tools/infer/predict_rec.py
+6
-0
tools/infer/predict_system.py
tools/infer/predict_system.py
+6
-0
tools/infer/utility.py
tools/infer/utility.py
+1
-0
No files found.
tools/infer/predict_det.py
View file @
1de1f30a
...
@@ -202,6 +202,12 @@ if __name__ == "__main__":
...
@@ -202,6 +202,12 @@ if __name__ == "__main__":
count
=
0
count
=
0
total_time
=
0
total_time
=
0
draw_img_save
=
"./inference_results"
draw_img_save
=
"./inference_results"
# warmup 10 times
if
args
.
warmup
:
img
=
np
.
random
.
uniform
(
0
,
255
,
[
640
,
640
,
3
]).
astype
(
np
.
uint8
)
for
i
in
range
(
10
):
res
=
text_detector
(
img
)
if
not
os
.
path
.
exists
(
draw_img_save
):
if
not
os
.
path
.
exists
(
draw_img_save
):
os
.
makedirs
(
draw_img_save
)
os
.
makedirs
(
draw_img_save
)
for
image_file
in
image_file_list
:
for
image_file
in
image_file_list
:
...
...
tools/infer/predict_rec.py
View file @
1de1f30a
...
@@ -254,6 +254,12 @@ def main(args):
...
@@ -254,6 +254,12 @@ def main(args):
total_images_num
=
0
total_images_num
=
0
valid_image_file_list
=
[]
valid_image_file_list
=
[]
img_list
=
[]
img_list
=
[]
# warmup 10 times
if
args
.
warmup
:
img
=
np
.
random
.
uniform
(
0
,
255
,
[
32
,
320
,
3
]).
astype
(
np
.
uint8
)
for
i
in
range
(
10
):
res
=
text_recognizer
([
img
])
for
idx
,
image_file
in
enumerate
(
image_file_list
):
for
idx
,
image_file
in
enumerate
(
image_file_list
):
img
,
flag
=
check_and_read_gif
(
image_file
)
img
,
flag
=
check_and_read_gif
(
image_file
)
if
not
flag
:
if
not
flag
:
...
...
tools/infer/predict_system.py
View file @
1de1f30a
...
@@ -147,6 +147,12 @@ def main(args):
...
@@ -147,6 +147,12 @@ def main(args):
is_visualize
=
True
is_visualize
=
True
font_path
=
args
.
vis_font_path
font_path
=
args
.
vis_font_path
drop_score
=
args
.
drop_score
drop_score
=
args
.
drop_score
# warm up 10 times
if
args
.
warmup
:
img
=
np
.
random
.
uniform
(
0
,
255
,
[
640
,
640
,
3
]).
astype
(
np
.
uint8
)
for
i
in
range
(
10
):
res
=
text_sys
(
img
)
for
image_file
in
image_file_list
:
for
image_file
in
image_file_list
:
img
,
flag
=
check_and_read_gif
(
image_file
)
img
,
flag
=
check_and_read_gif
(
image_file
)
if
not
flag
:
if
not
flag
:
...
...
tools/infer/utility.py
View file @
1de1f30a
...
@@ -105,6 +105,7 @@ def init_args():
...
@@ -105,6 +105,7 @@ def init_args():
parser
.
add_argument
(
"--enable_mkldnn"
,
type
=
str2bool
,
default
=
False
)
parser
.
add_argument
(
"--enable_mkldnn"
,
type
=
str2bool
,
default
=
False
)
parser
.
add_argument
(
"--cpu_threads"
,
type
=
int
,
default
=
10
)
parser
.
add_argument
(
"--cpu_threads"
,
type
=
int
,
default
=
10
)
parser
.
add_argument
(
"--use_pdserving"
,
type
=
str2bool
,
default
=
False
)
parser
.
add_argument
(
"--use_pdserving"
,
type
=
str2bool
,
default
=
False
)
parser
.
add_argument
(
"--warmup"
,
type
=
str2bool
,
default
=
True
)
parser
.
add_argument
(
"--use_mp"
,
type
=
str2bool
,
default
=
False
)
parser
.
add_argument
(
"--use_mp"
,
type
=
str2bool
,
default
=
False
)
parser
.
add_argument
(
"--total_process_num"
,
type
=
int
,
default
=
1
)
parser
.
add_argument
(
"--total_process_num"
,
type
=
int
,
default
=
1
)
...
...
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