ONE - On-device Neural Engine
Loading...
Searching...
No Matches
model_runner_onnx Namespace Reference

Functions

 run_onnx (model, input_path, output_path='')
 

Variables

 args = regular_step()
 

Function Documentation

◆ run_onnx()

model_runner_onnx.run_onnx (   model,
  input_path,
  output_path = '' 
)

Definition at line 7 of file model_runner_onnx.py.

7def run_onnx(model, input_path, output_path=''): #args.model[0] , args.input
8 path = model
9
10 #I'll leave it in case anyone needs to read the .pb file.
11 #proto_arr = onnx.TensorProto()
12 #with open(input_path, 'rb') as f:
13 # proto_arr.ParseFromString(f.read())
14 # input_arr = onnx.numpy_helper.to_array(proto_arr)
15
16 modelFile = onnx.load(path, 'rb')
17 input_arr = read_input(input_path)
18 output = caffe2.python.onnx.backend.run_model(modelFile, input_arr)
19
20 print(output)
21 save_result(output_path, output)
22
23

References common_place.read_input(), and common_place.save_result().

Variable Documentation

◆ args

model_runner_onnx.args = regular_step()

Definition at line 25 of file model_runner_onnx.py.