Commit 25e4f86c authored by liucong's avatar liucong
Browse files

修改python示例程序

parent 3e7e503b
...@@ -68,10 +68,18 @@ def ort_seg_dcu(model_path,image,staticInfer,dynamicInfer): ...@@ -68,10 +68,18 @@ def ort_seg_dcu(model_path,image,staticInfer,dynamicInfer):
provider_options=[{'device_id':'0','migraphx_fp16_enable':'true','dynamic_model':'true', 'migraphx_profile_max_shapes':'data:1x3x224x224'}] provider_options=[{'device_id':'0','migraphx_fp16_enable':'true','dynamic_model':'true', 'migraphx_profile_max_shapes':'data:1x3x224x224'}]
dcu_session = ort.InferenceSession(model_path, providers=['MIGraphXExecutionProvider'], provider_options=provider_options) dcu_session = ort.InferenceSession(model_path, providers=['MIGraphXExecutionProvider'], provider_options=provider_options)
input_name=dcu_session.get_inputs()[0].name images = [image]
input_nodes = dcu_session.get_inputs()
input_names = [i_n.name for i_n in input_nodes]
output_nodes = dcu_session.get_outputs()
output_names = [o_n.name for o_n in output_nodes]
results = dcu_session.run(None, input_feed={input_name:image}) input_dict = {}
scores=np.array(results[0]) for i_d, i_n in zip(images, input_names):
input_dict[i_n] = i_d
result = dcu_session.run([], input_dict)
scores=np.array(result[0])
print("ort result.shape:",scores.shape) print("ort result.shape:",scores.shape)
return scores return scores
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment