diff --git a/c_cxx/OpenVINO_EP/Windows/CMakeLists.txt b/c_cxx/OpenVINO_EP/Windows/CMakeLists.txt index 0e4be9a02..5d63b54c6 100644 --- a/c_cxx/OpenVINO_EP/Windows/CMakeLists.txt +++ b/c_cxx/OpenVINO_EP/Windows/CMakeLists.txt @@ -17,7 +17,7 @@ option(OPENCL_INCLUDE "OpenCL header dir") if(NOT ONNXRUNTIME_ROOTDIR) set(ONNXRUNTIME_ROOTDIR "C:/Program Files/onnxruntime") endif() -include_directories("${ONNXRUNTIME_ROOTDIR}/include" "${ONNXRUNTIME_ROOTDIR}/include/onnxruntime/core/session") +include_directories("${ONNXRUNTIME_ROOTDIR}/include" "${ONNXRUNTIME_ROOTDIR}/include/onnxruntime/") link_directories("${ONNXRUNTIME_ROOTDIR}/lib") if(OPENCV_ROOTDIR) diff --git a/c_cxx/OpenVINO_EP/Windows/README.md b/c_cxx/OpenVINO_EP/Windows/README.md index 432cb34d3..6dbdb537e 100644 --- a/c_cxx/OpenVINO_EP/Windows/README.md +++ b/c_cxx/OpenVINO_EP/Windows/README.md @@ -32,7 +32,7 @@ set OPENCL_INCS=\path\to\openvino\folder\thirdparty\ocl\clhpp_headers\include ``` ``` -build.bat --config RelWithDebInfo --use_openvino CPU_FP32 --build_shared_lib --parallel --cmake_extra_defines CMAKE_INSTALL_PREFIX=c:\dev\ort_install --skip_tests +build.bat --config RelWithDebInfo --use_openvino CPU --build_shared_lib --parallel --cmake_extra_defines CMAKE_INSTALL_PREFIX=c:\dev\ort_install --skip_tests ``` By default products of the build on Windows go to build\Windows\config folder. In the case above it would be build\Windows\RelWithDebInfo. @@ -79,7 +79,7 @@ msbuild onnxruntime_samples.sln /p:Configuration=Debug To run the samples make sure you source openvino variables using setupvars.bat. -To run the samples download and install(extract) OpenCV from: [download OpenCV](https://github.com/opencv/opencv/releases/download/4.7.0/opencv-4.7.0-windows.exe). Also copy OpenCV dll (opencv_world470.dll which is located at: "path\to\opencv\build\x64\vc16\bin") to the location of the application exe file(Release dll for Release build and debug dll for debug build). +To run the samples download and install(extract) OpenCV from: [download OpenCV](https://github.com/opencv/opencv/releases/download/4.7.0/opencv-4.7.0-windows.exe). Also copy OpenCV dll (opencv_world470.dll which is located at: "path\to\opencv\build\x64\vc16\bin") to the location of the application exe file(Release dll for release build) and (opencv_world470d.dll which is located at:"path\to\opencv\build\x64\vc16\bin") to the location of the application exe file (debug dll for debug build). #### Run the sample diff --git a/c_cxx/OpenVINO_EP/Windows/model-explorer/model-explorer.cpp b/c_cxx/OpenVINO_EP/Windows/model-explorer/model-explorer.cpp index e726f1899..3eb01ceee 100644 --- a/c_cxx/OpenVINO_EP/Windows/model-explorer/model-explorer.cpp +++ b/c_cxx/OpenVINO_EP/Windows/model-explorer/model-explorer.cpp @@ -65,7 +65,7 @@ int main(int argc, char** argv) { #ifdef USE_OPENVINO // Using OPENVINO backend OrtOpenVINOProviderOptions options; - options.device_type = "CPU_FP32"; //Other options are: GPU_FP32, GPU_FP16, MYRIAD_FP16 + options.device_type = "CPU"; std::cout << "OpenVINO device type is set to: " << options.device_type << std::endl; session_options.AppendExecutionProvider_OpenVINO(options); #endif diff --git a/c_cxx/OpenVINO_EP/Windows/squeezenet_classification/squeezenet_cpp_app.cpp b/c_cxx/OpenVINO_EP/Windows/squeezenet_classification/squeezenet_cpp_app.cpp index 19d4b067f..779c4e654 100644 --- a/c_cxx/OpenVINO_EP/Windows/squeezenet_classification/squeezenet_cpp_app.cpp +++ b/c_cxx/OpenVINO_EP/Windows/squeezenet_classification/squeezenet_cpp_app.cpp @@ -219,7 +219,7 @@ int main(int argc, char* argv[]) if (useOPENVINO) { // Using OPENVINO backend OrtOpenVINOProviderOptions options; - options.device_type = "CPU_FP32"; //Other options are: GPU_FP32, GPU_FP16, MYRIAD_FP16 + options.device_type = "CPU"; std::cout << "OpenVINO device type is set to: " << options.device_type << std::endl; sessionOptions.AppendExecutionProvider_OpenVINO(options); } diff --git a/c_cxx/OpenVINO_EP/Windows/squeezenet_classification_io_buffer/squeezenet_cpp_app_io_buffer.cpp b/c_cxx/OpenVINO_EP/Windows/squeezenet_classification_io_buffer/squeezenet_cpp_app_io_buffer.cpp index 81235cfbc..6ec161f1c 100644 --- a/c_cxx/OpenVINO_EP/Windows/squeezenet_classification_io_buffer/squeezenet_cpp_app_io_buffer.cpp +++ b/c_cxx/OpenVINO_EP/Windows/squeezenet_classification_io_buffer/squeezenet_cpp_app_io_buffer.cpp @@ -248,7 +248,7 @@ int main(int argc, char* argv[]) //Appending OpenVINO Execution Provider API // Using OPENVINO backend OrtOpenVINOProviderOptions options; - options.device_type = "GPU_FP32"; //Another options are: GPU_FP16, GPU.1_FP32, GPU.1_FP16, GPU.0_FP32, GPU.0_FP16 + options.device_type = "GPU"; options.context = (void *) ocl_instance->_context.get() ; std::cout << "OpenVINO device type is set to: " << options.device_type << std::endl; sessionOptions.AppendExecutionProvider_OpenVINO(options); diff --git a/c_sharp/OpenVINO_EP/yolov3_object_detection/Program.cs b/c_sharp/OpenVINO_EP/yolov3_object_detection/Program.cs index 19e95f708..259ba78c0 100644 --- a/c_sharp/OpenVINO_EP/yolov3_object_detection/Program.cs +++ b/c_sharp/OpenVINO_EP/yolov3_object_detection/Program.cs @@ -46,7 +46,7 @@ static void Main(string[] args) // Session Options using SessionOptions options = new SessionOptions(); options.LogSeverityLevel = OrtLoggingLevel.ORT_LOGGING_LEVEL_INFO; - options.AppendExecutionProvider_OpenVINO(@"MYRIAD_FP16"); + options.AppendExecutionProvider_OpenVINO(@"CPU"); options.AppendExecutionProvider_CPU(1); // Load the model @@ -190,15 +190,14 @@ static void Main(string[] args) count++; } } - - // Put boxes, labels and confidence on image and save for viewing + //put boxes, labels and confidence on image and save for viewing using var outputImage = File.OpenWrite(outImageFilePath); Font font = SystemFonts.CreateFont("Arial", 16); foreach (var p in predictions) { imageOrg.Mutate(x => { - x.DrawLines(Color.Red, 2f, new PointF[] { + x.DrawPolygon(Color.Red, 2f, new PointF[] { new PointF(p.Box.Xmin, p.Box.Ymin), new PointF(p.Box.Xmax, p.Box.Ymin), @@ -216,7 +215,6 @@ static void Main(string[] args) }); } imageOrg.Save(outputImage, new JpegEncoder()); - } } } diff --git a/c_sharp/OpenVINO_EP/yolov3_object_detection/yolov3_object_detection.csproj b/c_sharp/OpenVINO_EP/yolov3_object_detection/yolov3_object_detection.csproj index b36aa37e0..8cb5c5b7a 100644 --- a/c_sharp/OpenVINO_EP/yolov3_object_detection/yolov3_object_detection.csproj +++ b/c_sharp/OpenVINO_EP/yolov3_object_detection/yolov3_object_detection.csproj @@ -2,14 +2,14 @@ Exe - net6.0 + net8.0 enable enable - - + +