|
12 | 12 | import platform
|
13 | 13 |
|
14 | 14 | if platform.system() == "Windows":
|
15 |
| - from openvino import utils |
| 15 | + import onnxruntime.tools.add_openvino_win_libs as utils |
16 | 16 | utils.add_openvino_libs_to_path()
|
17 | 17 |
|
18 | 18 | # color look up table for different classes for object detection sample
|
|
29 | 29 |
|
30 | 30 | def parse_arguments():
|
31 | 31 | parser = argparse.ArgumentParser(description='Object Detection using YOLOv2 in OPENCV using OpenVINO Execution Provider for ONNXRuntime')
|
32 |
| - parser.add_argument('--device', default='CPU_FP32', help="Device to perform inference on 'cpu (MLAS)' or on devices supported by OpenVINO-EP [CPU_FP32, GPU_FP32, GPU_FP16, MYRIAD_FP16, VAD-M_FP16].") |
| 32 | + parser.add_argument('--device', default='CPU_FP32', help="Device to perform inference on 'cpu (MLAS)' or on devices supported by OpenVINO-EP [CPU_FP32, CPU_FP32, GPU_FP32, GPU_FP16].") |
33 | 33 | parser.add_argument('--video', help='Path to video file.')
|
34 | 34 | parser.add_argument('--model', help='Path to model.')
|
35 | 35 | args = parser.parse_args()
|
@@ -150,16 +150,16 @@ def main():
|
150 | 150 | print("Device type selected is 'cpu' which is the default CPU Execution Provider (MLAS)")
|
151 | 151 | #Specify the path to the ONNX model on your machine and register the CPU EP
|
152 | 152 | sess = rt.InferenceSession(args.model, so, providers=['CPUExecutionProvider'])
|
153 |
| - elif (args.device == 'CPU_FP32' or args.device == 'GPU_FP32' or args.device == 'GPU_FP16' or args.device == 'MYRIAD_FP16' or args.device == 'VADM_FP16'): |
| 153 | + elif (args.device == 'CPU_FP32', args.device == 'CPU_FP16' or args.device == 'GPU_FP32' or args.device == 'GPU_FP16'): |
154 | 154 | #Specify the path to the ONNX model on your machine and register the OpenVINO EP
|
155 | 155 | sess = rt.InferenceSession(args.model, so, providers=['OpenVINOExecutionProvider'], provider_options=[{'device_type' : args.device}])
|
156 | 156 | print("Device type selected is: " + args.device + " using the OpenVINO Execution Provider")
|
157 | 157 | '''
|
158 | 158 | other 'device_type' options are: (Any hardware target can be assigned if you have the access to it)
|
159 |
| - 'CPU_FP32', 'GPU_FP32', 'GPU_FP16', 'MYRIAD_FP16', 'VAD-M_FP16' |
| 159 | + 'CPU_FP32', 'CPU_FP16', 'GPU_FP32', 'GPU_FP16' |
160 | 160 | '''
|
161 | 161 | else:
|
162 |
| - raise Exception("Device type selected is not [cpu, CPU_FP32, GPU_FP32, GPU_FP16, MYRIAD_FP16, VADM_FP16]") |
| 162 | + raise Exception("Device type selected is not [cpu, CPU_FP32, GPU_FP32, GPU_FP16]") |
163 | 163 |
|
164 | 164 | # Get the input name of the model
|
165 | 165 | input_name = sess.get_inputs()[0].name
|
|
0 commit comments