Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
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