Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion c_cxx/OpenVINO_EP/Windows/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions c_cxx/OpenVINO_EP/Windows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 3 additions & 5 deletions c_sharp/OpenVINO_EP/yolov3_object_detection/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand All @@ -216,7 +215,6 @@ static void Main(string[] args)
});
}
imageOrg.Save(outputImage, new JpegEncoder());

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.ML.OnnxRuntime" Version="1.16.0" />
<PackageReference Include="Microsoft.ML.OnnxRuntime.Managed" Version="1.16.0" />
<PackageReference Include="Microsoft.ML.OnnxRuntime.Managed" Version="1.19.0" />
<PackageReference Include="Microsoft.ML.OnnxRuntime.OpenVino" Version="1.19.0" />
<PackageReference Include="SixLabors.Core" Version="1.0.0-beta0008" />
<PackageReference Include="SixLabors.Fonts" Version="1.0.0-beta19" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
Expand Down
Loading