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
af399022
Commit
af399022
authored
May 11, 2020
by
LDOUBLEV
Browse files
fix tools/infer/utility.py
parent
3f2d384f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
23 deletions
+2
-23
tools/infer/utility.py
tools/infer/utility.py
+2
-23
No files found.
tools/infer/utility.py
View file @
af399022
...
...
@@ -99,7 +99,8 @@ def create_predictor(args, mode):
config
.
disable_gpu
()
config
.
disable_glog_info
()
config
.
switch_ir_optim
(
args
.
ir_optim
)
# config.switch_ir_optim(args.ir_optim)
# if args.use_tensorrt:
# config.enable_tensorrt_engine(
# precision_mode=AnalysisConfig.Precision.Half
...
...
@@ -127,25 +128,3 @@ def draw_text_det_res(dt_boxes, img_path):
cv2
.
polylines
(
src_im
,
[
box
],
True
,
color
=
(
255
,
255
,
0
),
thickness
=
2
)
img_name_pure
=
img_path
.
split
(
"/"
)[
-
1
]
cv2
.
imwrite
(
"./output/%s"
%
img_name_pure
,
src_im
)
if
__name__
==
'__main__'
:
args
=
parse_args
()
args
.
use_gpu
=
False
root_path
=
"/Users/liuweiwei06/Desktop/TEST_CODES/icode/baidu/personal-code/PaddleOCR/"
args
.
det_model_dir
=
root_path
+
"test_models/public_v1/ch_det_mv3_db"
predictor
,
input_tensor
,
output_tensors
=
create_predictor
(
args
,
mode
=
'det'
)
print
(
"det input"
,
predictor
.
get_input_names
())
print
(
"det output"
,
predictor
.
get_output_names
())
# print(predictor.program(), file=open("det_program.txt", 'w'))
outputs
=
[]
for
output_tensor
in
output_tensors
:
output
=
output_tensor
.
copy_to_cpu
()
outputs
.
append
(
output
)
args
.
rec_model_dir
=
root_path
+
"test_models/public_v1/ch_rec_mv3_crnn/"
rec_predictor
,
input_tensor
,
output_tensors
=
create_predictor
(
args
,
mode
=
'rec'
)
print
(
"rec input"
,
rec_predictor
.
get_input_names
())
print
(
"rec output"
,
rec_predictor
.
get_output_names
())
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