Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6408 Discussions

OpenVINO using YoloV8 Object Detection model in .Net Core

RGVGreatCoder
Novice
2,642 Views

Hello,

Do you have any links and code to learn on how to use OpenVINO with an Ultralytics YoloV8 Object Detection model on an ASP.Net Core UWP?

I asked OpenAI ChatGPT and strangely, it said to first of all, use Nuget Package Manager to install these packages:

 

 

Intel.OpenVINO.IE.Core
Intel.OpenVINO.IE.DebuggerVisualizers

 

 

However, I cannot find these packages anywhere.

ChatGPT then provided the following code:

 

 

var ie = new IECore();
var network = ie.ReadNetwork("<path-to-converted-model.xml>", "<path-to-converted-model.bin>");
var execNet = ie.LoadNetwork(network, "CPU");
var frame = new Mat();

while (videoCapture.Read(frame))
{
   var resizedFrame = new Mat();
   Cv2.Resize(frame, resizedFrame, new Size(416, 416));

   var inputData = new float[1, 3, 416, 416];
   for (int c = 0; c < 3; c++)
   {
      for (int h = 0; h < 416; h++)
      {
         for (int w = 0; w < 416; w++)
         {
            inputData[0, c, h, w] = resizedFrame.Data[h, w, c] / 255f;
         }
      }
   }

   var inferRequest = execNet.CreateInferRequest();
   inferRequest.SetBlob(network.Inputs.First().Key, inputData);
   inferRequest.Infer();
   var outputData = inferRequest.GetBlob(network.Outputs.First().Key).GetData<float>();

   // Post-process output data
}

 

Of course, I am unable to test this given code since I am unable to install the suggested packages.

 

Please let me know how to implement OpenVINO with an Ultralytics YoloV8 Object Detetion model in an ASP.Net Core (C#) UWP.

 

Thanks

 

0 Kudos
4 Replies
Iffa_Intel
Moderator
2,579 Views

Hi,

 

OpenVINO does support YoloV8 model but not ASP.Net Core UWP.

It is recommended to use Python with YoloV8 in OpenVINO.

You may refer here.

 

 

Cordially,

Iffa

 

0 Kudos
RGVGreatCoder
Novice
2,561 Views

I understand it is recommended to use Python with YoloV8 in OpenVINO. I tried it and it works. In fact, I have a separate project in Python using it and works like a charm.

Thing is, I have a large .net core, data driven project that needs to run on a low edge device with an Intel CPU and UHD Graphics 620 that will do real-time object detection. I have achieved this using Windows.AI.MachineLearning and an onnx model created in customvision.ai online tool. However, it processes around 14 FPS and I need at least 28 FPS. The Python project can process up to 38 FPS in the same device. But again, I need to use OpenVINO in this separate .net core program.

Why did OpenAI ChatGPT asked me to use Nuget Package Manager to install the two packages I mentioned on my original post? And, why did it even provided me with sample code? Did ChatGPT provided me 100% fake content or is there still a way to use it in a .net core application?

0 Kudos
Iffa_Intel
Moderator
2,545 Views

We are not sure of what the ChatGPT algorithm running in the background that causing it to suggest that to you.

Officially, OpenVINO does not provide support for .NET as of now.

The code that you share which you claim to be suggested by ChatGPT is in Python programming language.

 

Generally, the Nuget package manager is just a tool to pack and distribute .NET software.

IECore is a part of OpenVINO API libraries and in this case, it seems that the ChatGPT is instructing you to handle those libraries using Nuget Package Manager.

 

Perhaps these are suggested by the ChatGPT algorithm since Visual Studio is a prerequisite by OpenVINO and .NET is involved and that result is closely related to what you were asking it.

 

Your possible workaround is to design and create a wrapper to make interoperability between your .NET apps and OpenVINO, but again, bear in mind that officially, .NET is not officially supported and therefore, issues are expected.

 

 

Cordially,

Iffa

 

 

 

 

0 Kudos
Iffa_Intel
Moderator
2,392 Views

Hi,


Intel will no longer monitor this thread since we have provided a solution. If you need any additional information from Intel, please submit a new question. 



Cordially,

Iffa


0 Kudos
Reply