Skip to content

Commit c8ca4ad

Browse files
committed
Updated scripts for Openvino C_Sharp_samples
1 parent 0de2e66 commit c8ca4ad

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

c_sharp/OpenVINO_EP/yolov3_object_detection/Program.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static void Main(string[] args)
4646
// Session Options
4747
using SessionOptions options = new SessionOptions();
4848
options.LogSeverityLevel = OrtLoggingLevel.ORT_LOGGING_LEVEL_INFO;
49-
options.AppendExecutionProvider_OpenVINO(@"MYRIAD_FP16");
49+
options.AppendExecutionProvider_OpenVINO(@"CPU");
5050
options.AppendExecutionProvider_CPU(1);
5151

5252
// Load the model
@@ -190,15 +190,14 @@ static void Main(string[] args)
190190
count++;
191191
}
192192
}
193-
194-
// Put boxes, labels and confidence on image and save for viewing
193+
//put boxes, labels and confidence on image and save for viewing
195194
using var outputImage = File.OpenWrite(outImageFilePath);
196195
Font font = SystemFonts.CreateFont("Arial", 16);
197196
foreach (var p in predictions)
198197
{
199198
imageOrg.Mutate(x =>
200199
{
201-
x.DrawLines(Color.Red, 2f, new PointF[] {
200+
x.DrawPolygon(Color.Red, 2f, new PointF[] {
202201

203202
new PointF(p.Box.Xmin, p.Box.Ymin),
204203
new PointF(p.Box.Xmax, p.Box.Ymin),
@@ -216,7 +215,6 @@ static void Main(string[] args)
216215
});
217216
}
218217
imageOrg.Save(outputImage, new JpegEncoder());
219-
220218
}
221219
}
222220
}

c_sharp/OpenVINO_EP/yolov3_object_detection/yolov3_object_detection.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.ML.OnnxRuntime" Version="1.16.0" />
12-
<PackageReference Include="Microsoft.ML.OnnxRuntime.Managed" Version="1.16.0" />
11+
<PackageReference Include="Microsoft.ML.OnnxRuntime.Managed" Version="1.19.0" />
12+
<PackageReference Include="Microsoft.ML.OnnxRuntime.OpenVino" Version="1.19.0" />
1313
<PackageReference Include="SixLabors.Core" Version="1.0.0-beta0008" />
1414
<PackageReference Include="SixLabors.Fonts" Version="1.0.0-beta19" />
1515
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />

0 commit comments

Comments
 (0)