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
ModelZoo
LPRNet_pytorch
Commits
9adcf60d
Commit
9adcf60d
authored
Feb 27, 2023
by
liuhy
Browse files
修改代码
parent
7673d3b4
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
5 deletions
+4
-5
LPRNet_migraphx_infer.py
LPRNet_migraphx_infer.py
+4
-5
__pycache__/load_data.cpython-37.pyc
__pycache__/load_data.cpython-37.pyc
+0
-0
__pycache__/lprnet.cpython-37.pyc
__pycache__/lprnet.cpython-37.pyc
+0
-0
model/LPRNet.mxr
model/LPRNet.mxr
+0
-0
No files found.
LPRNet_migraphx_infer.py
View file @
9adcf60d
...
...
@@ -49,11 +49,10 @@ def LPRNetInference(model_name, imgs):
if
model_name
[
-
3
:]
==
'mxr'
:
model
=
migraphx
.
load
(
model_name
)
else
:
print
(
'convert onnx to mxr...'
)
model
=
migraphx
.
parse_onnx
(
model_name
)
# migraphx.quantize_fp16(model)
model
.
compile
(
t
=
migraphx
.
get_target
(
"gpu"
),
device_id
=
0
)
# device_id: 设置GPU设备,默认为0号设备(>=1.2版本中支持)
path
=
model_name
.
split
(
'/'
)
migraphx
.
save
(
model
,
'/'
.
join
((
path
[:
-
1
],
path
[
-
1
][
-
4
]
+
'mxr'
)))
migraphx
.
save
(
model
,
'model/LPRNet.mxr'
)
inputName
=
model
.
get_parameter_names
()[
0
]
inputShape
=
model
.
get_parameter_shapes
()[
inputName
].
lens
()
...
...
@@ -65,8 +64,8 @@ def LPRNetInference(model_name, imgs):
return
result
if
__name__
==
'__main__'
:
model_name
=
'LPRNet.onnx'
#
model_name = 'model/LPRNet.mxr'
#
model_name = '
model/
LPRNet.onnx'
model_name
=
'model/LPRNet.mxr'
image
=
'imgs/川JK0707.jpg'
InferRes
=
LPRNetInference
(
model_name
,
image
)
print
(
image
,
'Inference Result:'
,
InferRes
)
__pycache__/load_data.cpython-37.pyc
View file @
9adcf60d
No preview for this file type
__pycache__/lprnet.cpython-37.pyc
View file @
9adcf60d
No preview for this file type
model/LPRNet.mxr
View file @
9adcf60d
No preview for this file type
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