diff --git a/c_sharp/OpenVINO_EP/yolov3_object_detection/Program.cs b/c_sharp/OpenVINO_EP/yolov3_object_detection/Program.cs index cdddc5628..875b2e285 100644 --- a/c_sharp/OpenVINO_EP/yolov3_object_detection/Program.cs +++ b/c_sharp/OpenVINO_EP/yolov3_object_detection/Program.cs @@ -108,7 +108,7 @@ static void Main(string[] args) // Session Options SessionOptions options = new SessionOptions(); options.LogSeverityLevel = OrtLoggingLevel.ORT_LOGGING_LEVEL_INFO; - options.AppendExecutionProvider_OpenVINO(@"MYRIAD_FP16"); + options.AppendExecutionProvider_OpenVINO(@"CPU_FP32"); options.AppendExecutionProvider_CPU(1); // Run inference diff --git a/c_sharp/OpenVINO_EP/yolov3_object_detection/README.md b/c_sharp/OpenVINO_EP/yolov3_object_detection/README.md index b45ca49b0..3e2906fdd 100644 --- a/c_sharp/OpenVINO_EP/yolov3_object_detection/README.md +++ b/c_sharp/OpenVINO_EP/yolov3_object_detection/README.md @@ -2,7 +2,7 @@ 1. The object detection sample uses YOLOv3 Deep Learning ONNX Model from the ONNX Model Zoo. -2. The sample involves presenting an image to the ONNX Runtime (RT), which uses the OpenVINO Execution Provider for ONNX RT to run inference on Intel® NCS2 stick (MYRIADX device). The sample uses ImageSharp for image processing and ONNX Runtime OpenVINO EP for inference. +2. The sample involves presenting an image to the ONNX Runtime (RT), which uses the OpenVINO Execution Provider for ONNX RT to run inference on Intel® CPU. The sample uses ImageSharp for image processing and ONNX Runtime OpenVINO EP for inference. The source code for this sample is available [here](https://github.com/microsoft/onnxruntime-inference-examples/tree/main/c_sharp/OpenVINO_EP/yolov3_object_detection). diff --git a/python/OpenVINO_EP/tiny_yolo_v2_object_detection/requirements.txt b/python/OpenVINO_EP/tiny_yolo_v2_object_detection/requirements.txt index 133323664..f8a119cee 100644 --- a/python/OpenVINO_EP/tiny_yolo_v2_object_detection/requirements.txt +++ b/python/OpenVINO_EP/tiny_yolo_v2_object_detection/requirements.txt @@ -1,9 +1,9 @@ certifi==2022.5.18.1 flatbuffers==2.0 -numpy==1.22.4 -onnx==1.11.0 +numpy==1.23.5 +onnx==1.13.0 opencv-python==4.5.5.64 Pillow==9.3.0 -protobuf==4.21.6 -scipy==1.7.3 +protobuf==3.20.2 +scipy==1.9.0 typing-extensions==4.2.0 diff --git a/python/OpenVINO_EP/tiny_yolo_v2_object_detection/tiny_yolov2_obj_detection_sample.py b/python/OpenVINO_EP/tiny_yolo_v2_object_detection/tiny_yolov2_obj_detection_sample.py index b7cb56ac2..8da783ba1 100644 --- a/python/OpenVINO_EP/tiny_yolo_v2_object_detection/tiny_yolov2_obj_detection_sample.py +++ b/python/OpenVINO_EP/tiny_yolo_v2_object_detection/tiny_yolov2_obj_detection_sample.py @@ -133,7 +133,8 @@ def postprocess_output(out, frame, x_scale, y_scale, i): def show_bbox(device, frame, inference_time): cv2.putText(frame,device,(10,20),cv2.FONT_HERSHEY_COMPLEX,0.5,(255,255,255),1) - cv2.putText(frame,'FPS: {}'.format(1.0/inference_time),(10,40),cv2.FONT_HERSHEY_COMPLEX,0.5,(255,255,255),1) + if (inference_time!=0): + cv2.putText(frame,'FPS: {}'.format(1.0/inference_time),(10,40),cv2.FONT_HERSHEY_COMPLEX,0.5,(255,255,255),1) frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) cv2.imshow('frame',frame) @@ -150,16 +151,16 @@ def main(): print("Device type selected is 'cpu' which is the default CPU Execution Provider (MLAS)") #Specify the path to the ONNX model on your machine and register the CPU EP sess = rt.InferenceSession(args.model, so, providers=['CPUExecutionProvider']) - 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'): + elif (args.device == 'CPU_FP32' or args.device == 'CPU_FP16' or args.device == 'GPU_FP32' or args.device == 'GPU_FP16' or args.device == 'MYRIAD_FP16' or args.device == 'VADM_FP16'): #Specify the path to the ONNX model on your machine and register the OpenVINO EP sess = rt.InferenceSession(args.model, so, providers=['OpenVINOExecutionProvider'], provider_options=[{'device_type' : args.device}]) print("Device type selected is: " + args.device + " using the OpenVINO Execution Provider") ''' other 'device_type' options are: (Any hardware target can be assigned if you have the access to it) - 'CPU_FP32', 'GPU_FP32', 'GPU_FP16', 'MYRIAD_FP16', 'VAD-M_FP16' + 'CPU_FP32', 'CPU_FP16', 'GPU_FP32', 'GPU_FP16', 'MYRIAD_FP16', 'VAD-M_FP16' ''' else: - raise Exception("Device type selected is not [cpu, CPU_FP32, GPU_FP32, GPU_FP16, MYRIAD_FP16, VADM_FP16]") + raise Exception("Device type selected is not [cpu, CPU_FP32, CPU_FP16, GPU_FP32, GPU_FP16, MYRIAD_FP16, VADM_FP16]") # Get the input name of the model input_name = sess.get_inputs()[0].name diff --git a/python/OpenVINO_EP/yolov4_object_detection/requirements.txt b/python/OpenVINO_EP/yolov4_object_detection/requirements.txt index 133323664..f8a119cee 100644 --- a/python/OpenVINO_EP/yolov4_object_detection/requirements.txt +++ b/python/OpenVINO_EP/yolov4_object_detection/requirements.txt @@ -1,9 +1,9 @@ certifi==2022.5.18.1 flatbuffers==2.0 -numpy==1.22.4 -onnx==1.11.0 +numpy==1.23.5 +onnx==1.13.0 opencv-python==4.5.5.64 Pillow==9.3.0 -protobuf==4.21.6 -scipy==1.7.3 +protobuf==3.20.2 +scipy==1.9.0 typing-extensions==4.2.0 diff --git a/python/OpenVINO_EP/yolov4_object_detection/yolov4.py b/python/OpenVINO_EP/yolov4_object_detection/yolov4.py index f2f457b98..0a83e4e06 100644 --- a/python/OpenVINO_EP/yolov4_object_detection/yolov4.py +++ b/python/OpenVINO_EP/yolov4_object_detection/yolov4.py @@ -327,7 +327,8 @@ def main(): image = draw_bbox(original_image, bboxes) cv2.putText(image,device,(10,20),cv2.FONT_HERSHEY_COMPLEX,0.5,(255,255,255),1) - cv2.putText(image,'FPS: {}'.format(1.0/inference_time),(10,40),cv2.FONT_HERSHEY_COMPLEX,0.5,(255,255,255),1) + if (inference_time!=0): + cv2.putText(image,'FPS: {}'.format(1.0/inference_time),(10,40),cv2.FONT_HERSHEY_COMPLEX,0.5,(255,255,255),1) # Write the frame with the detection boxes if (args.image):