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
PaddleOCR_migraphx
Commits
97c70f1a
Commit
97c70f1a
authored
Jun 01, 2023
by
Your Name
Browse files
修改模型输入数据格式
parent
5274a8cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
Python/PaddleOCR_infer_migraphx.py
Python/PaddleOCR_infer_migraphx.py
+3
-2
No files found.
Python/PaddleOCR_infer_migraphx.py
View file @
97c70f1a
...
@@ -454,9 +454,10 @@ class det_rec_functions(object):
...
@@ -454,9 +454,10 @@ class det_rec_functions(object):
img_part
,
shape_part_list
=
data_part
img_part
,
shape_part_list
=
data_part
img_part
=
np
.
expand_dims
(
img_part
,
axis
=
0
)
img_part
=
np
.
expand_dims
(
img_part
,
axis
=
0
)
shape_part_list
=
np
.
expand_dims
(
shape_part_list
,
axis
=
0
)
shape_part_list
=
np
.
expand_dims
(
shape_part_list
,
axis
=
0
)
img_part
=
np
.
ascontiguousarray
(
img_part
)
# migraphx推理
# migraphx推理
resultDets
=
self
.
modelDet
.
run
({
self
.
modelDet
.
get_parameter_names
()[
0
]:
migraphx
.
argument
(
img_part
)
})
resultDets
=
self
.
modelDet
.
run
({
self
.
modelDet
.
get_parameter_names
()[
0
]:
img_part
})
# 获取第一个输出节点的数据,migraphx.argument类型
# 获取第一个输出节点的数据,migraphx.argument类型
resultDet
=
resultDets
[
0
]
resultDet
=
resultDets
[
0
]
outs_part
=
np
.
array
(
resultDet
)
outs_part
=
np
.
array
(
resultDet
)
...
@@ -499,7 +500,7 @@ class det_rec_functions(object):
...
@@ -499,7 +500,7 @@ class det_rec_functions(object):
img
=
img
[
np
.
newaxis
,
:]
img
=
img
[
np
.
newaxis
,
:]
# migraphx推理
# migraphx推理
results
=
self
.
modelRec
.
run
({
self
.
modelRec
.
get_parameter_names
()[
0
]:
migraphx
.
argument
(
img
)
})
results
=
self
.
modelRec
.
run
({
self
.
modelRec
.
get_parameter_names
()[
0
]:
img
})
# 获取第一个输出节点的数据,migraphx.argument类型
# 获取第一个输出节点的数据,migraphx.argument类型
result
=
results
[
0
]
result
=
results
[
0
]
outs
=
np
.
array
(
result
)
outs
=
np
.
array
(
result
)
...
...
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