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

Functions

 run_tflite (model, input_path, output_path='')
 

Variables

 args = regular_step()
 

Function Documentation

◆ run_tflite()

model_runner_tflite.run_tflite (   model,
  input_path,
  output_path = '' 
)

Definition at line 5 of file model_runner_tflite.py.

5def run_tflite(model, input_path, output_path=''):
6 input = read_input(input_path)
7
8 interpreter = tf.contrib.lite.Interpreter(model_path=model)
9 interpreter.allocate_tensors()
10
11 input_details = interpreter.get_input_details()
12 output_details = interpreter.get_output_details()
13 input_data = input
14 interpreter.set_tensor(input_details[0]['index'], input_data)
15
16 interpreter.invoke()
17 output_data = interpreter.get_tensor(output_details[0]['index'])
18 print(output_data)
19 save_result(output_path, output_data)
20
21

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

Variable Documentation

◆ args

model_runner_tflite.args = regular_step()

Definition at line 23 of file model_runner_tflite.py.