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
10880fc1
You need to sign in or sign up before continuing.
Unverified
Commit
10880fc1
authored
Jul 27, 2020
by
littletomatodonkey
Committed by
GitHub
Jul 27, 2020
Browse files
Merge pull request #424 from littletomatodonkey/fix_save
fix save img for pred_det
parents
c1ba9643
0aebfbc2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
tools/infer/predict_det.py
tools/infer/predict_det.py
+5
-1
No files found.
tools/infer/predict_det.py
View file @
10880fc1
...
@@ -135,6 +135,9 @@ if __name__ == "__main__":
...
@@ -135,6 +135,9 @@ if __name__ == "__main__":
text_detector
=
TextDetector
(
args
)
text_detector
=
TextDetector
(
args
)
count
=
0
count
=
0
total_time
=
0
total_time
=
0
draw_img_save
=
"./inference_results"
if
not
os
.
path
.
exists
(
draw_img_save
):
os
.
makedirs
(
draw_img_save
)
for
image_file
in
image_file_list
:
for
image_file
in
image_file_list
:
img
=
cv2
.
imread
(
image_file
)
img
=
cv2
.
imread
(
image_file
)
if
img
is
None
:
if
img
is
None
:
...
@@ -147,6 +150,7 @@ if __name__ == "__main__":
...
@@ -147,6 +150,7 @@ if __name__ == "__main__":
print
(
"Predict time of %s:"
%
image_file
,
elapse
)
print
(
"Predict time of %s:"
%
image_file
,
elapse
)
src_im
=
utility
.
draw_text_det_res
(
dt_boxes
,
image_file
)
src_im
=
utility
.
draw_text_det_res
(
dt_boxes
,
image_file
)
img_name_pure
=
image_file
.
split
(
"/"
)[
-
1
]
img_name_pure
=
image_file
.
split
(
"/"
)[
-
1
]
cv2
.
imwrite
(
"./inference_results/det_res_%s"
%
img_name_pure
,
src_im
)
cv2
.
imwrite
(
os
.
path
.
join
(
draw_img_save
,
"det_res_%s"
%
img_name_pure
),
src_im
)
if
count
>
1
:
if
count
>
1
:
print
(
"Avg Time:"
,
total_time
/
(
count
-
1
))
print
(
"Avg Time:"
,
total_time
/
(
count
-
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