Code Monkey home page Code Monkey logo

Comments (4)

github-actions avatar github-actions commented on July 18, 2024

πŸ‘‹ Hello @arturcortellijunior, thank you for raising an issue about Ultralytics HUB πŸš€! Please visit our HUB Docs to learn more:

  • Quickstart. Start training and deploying YOLO models with HUB in seconds.
  • Datasets: Preparing and Uploading. Learn how to prepare and upload your datasets to HUB in YOLO format.
  • Projects: Creating and Managing. Group your models into projects for improved organization.
  • Models: Training and Exporting. Train YOLOv5 and YOLOv8 models on your custom datasets and export them to various formats for deployment.
  • Integrations. Explore different integration options for your trained models, such as TensorFlow, ONNX, OpenVINO, CoreML, and PaddlePaddle.
  • Ultralytics HUB App. Learn about the Ultralytics App for iOS and Android, which allows you to run models directly on your mobile device.
    • iOS. Learn about YOLO CoreML models accelerated on Apple's Neural Engine on iPhones and iPads.
    • Android. Explore TFLite acceleration on mobile devices.
  • Inference API. Understand how to use the Inference API for running your trained models in the cloud to generate predictions.

If this is a πŸ› Bug Report, please provide screenshots and steps to reproduce your problem to help us get started working on a fix.

If this is a ❓ Question, please provide as much information as possible, including dataset, model, environment details etc. so that we might provide the most helpful response.

We try to respond to all issues as promptly as possible. Thank you for your patience!

from hub.

pderrenger avatar pderrenger commented on July 18, 2024

Hello! It's great to hear that you've successfully trained and used your model with ONNX and C#. For integrating OpenVino with C#, you might need to adjust your approach since direct support can be limited.

For using OpenVino in C#, you generally need to use the OpenVino Runtime which is primarily designed for C++ and Python. However, you can create a C++ DLL that wraps the OpenVino functionality and then use P/Invoke in C# to call the functions from this DLL.

Here’s a very basic outline of the steps:

  1. Create a C++ DLL that loads the OpenVino model and performs inference.
  2. Use P/Invoke in C# to interact with the DLL.

C++ DLL example (simplified):

extern "C" __declspec(dllexport) int LoadModel(const char* modelPath) {
    // Load model with OpenVino here
    return 0; // Return an error code or success
}

extern "C" __declspec(dllexport) int PerformInference(const char* imagePath, char* outputData, int outputLength) {
    // Perform inference here
    return 0; // Return an error code or success
}

C# P/Invoke setup:

class OpenVinoInterop {
    [DllImport("YourModelDLL.dll", CharSet = CharSet.Ansi)]
    public static extern int LoadModel(string modelPath);

    [DllImport("YourModelDLL.dll", CharSet = CharSet.Ansi)]
    public static extern int PerformInference(string imagePath, StringBuilder outputData, int outputLength);
}

You would need to handle data marshaling between C# and C++ carefully, especially for image data and inference results.

This approach requires a good understanding of both C++ and C# interop features but can be very powerful. If you're not familiar with C++ or DLL creation, it might require some additional learning or collaboration with someone who has these skills.

Hope this helps you get started with using OpenVino in your C# environment! πŸš€

from hub.

arturcortellijunior avatar arturcortellijunior commented on July 18, 2024

Hi Paula, thanks for getting back to us.
Do you happen to have the Wrapper for this?
We can't create it in C++ here.

Hello! It's great to hear that you've successfully trained and used your model with ONNX and C#. For integrating OpenVino with C#, you might need to adjust your approach since direct support can be limited.

For using OpenVino in C#, you generally need to use the OpenVino Runtime which is primarily designed for C++ and Python. However, you can create a C++ DLL that wraps the OpenVino functionality and then use P/Invoke in C# to call the functions from this DLL.

Here’s a very basic outline of the steps:

  1. Create a C++ DLL that loads the OpenVino model and performs inference.
  2. Use P/Invoke in C# to interact with the DLL.

C++ DLL example (simplified):

extern "C" __declspec(dllexport) int LoadModel(const char* modelPath) {
    // Load model with OpenVino here
    return 0; // Return an error code or success
}

extern "C" __declspec(dllexport) int PerformInference(const char* imagePath, char* outputData, int outputLength) {
    // Perform inference here
    return 0; // Return an error code or success
}

C# P/Invoke setup:

class OpenVinoInterop {
    [DllImport("YourModelDLL.dll", CharSet = CharSet.Ansi)]
    public static extern int LoadModel(string modelPath);

    [DllImport("YourModelDLL.dll", CharSet = CharSet.Ansi)]
    public static extern int PerformInference(string imagePath, StringBuilder outputData, int outputLength);
}

You would need to handle data marshaling between C# and C++ carefully, especially for image data and inference results.

This approach requires a good understanding of both C++ and C# interop features but can be very powerful. If you're not familiar with C++ or DLL creation, it might require some additional learning or collaboration with someone who has these skills.

Hope this helps you get started with using OpenVino in your C# environment! πŸš€

from hub.

pderrenger avatar pderrenger commented on July 18, 2024

@arturcortellijunior hello!

Unfortunately, we don't have a pre-made C++ wrapper available for OpenVino that you can use directly. Creating such a wrapper requires specific expertise in both C++ and the OpenVino toolkit.

If creating a C++ DLL isn't feasible in your current setup, you might consider looking for external C++ development resources or consulting services that could assist in this task. Another alternative could be to explore if any community projects or third-party libraries offer a similar functionality that could be integrated into your project.

Sorry I couldn't provide a direct solution this time! If you have any more questions or need further assistance, feel free to ask. 🌟

from hub.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.