Skip to content

Commit 907e9cf

Browse files
mayavijxMaajidKhan
authored andcommitted
Use OS specific font in csharp sample
1 parent fdb1ccf commit 907e9cf

File tree

1 file changed

+3
-1
lines changed
  • c_sharp/OpenVINO_EP/yolov3_object_detection

1 file changed

+3
-1
lines changed

c_sharp/OpenVINO_EP/yolov3_object_detection/Program.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using SixLabors.ImageSharp.Formats;
1616
using SixLabors.ImageSharp.Drawing.Processing;
1717
using SixLabors.Fonts;
18+
using System.Runtime.InteropServices;
1819

1920
namespace yolov3
2021
{
@@ -144,7 +145,8 @@ static void Main(string[] args)
144145

145146
// Put boxes, labels and confidence on image and save for viewing
146147
using var outputImage = File.OpenWrite(outImageFilePath);
147-
Font font = SystemFonts.CreateFont("FreeMono", 16);
148+
// Using FreeMono font for Linux and Arial for others
149+
Font font = (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) ? SystemFonts.CreateFont("FreeMono", 16) : SystemFonts.CreateFont("Arial", 16);
148150
foreach (var p in predictions)
149151
{
150152
imageOrg.Mutate(x =>

0 commit comments

Comments
 (0)