Git Product home page Git Product logo

Comments (4)

dme-compunet avatar dme-compunet commented on June 21, 2024 2

@GuenKainto

using var predictor = YoloV8Builder.CreateDefaultBuilder()
                                   .UseOnnxModel("path/to/model.onnx")
                                   .WithConfiguration(configuration => 
                                   {
                                       configuration.Confidence = 3.5f,
                                       configuration.IoU = ...
                                   })
                                   .Build();

from yolov8.

aloksharma1 avatar aloksharma1 commented on June 21, 2024 1

here check this

_predictor = YoloV8Predictor.Create("yolov8x.onnx")); //path to model
using var image = Image.Load<Rgb48>(imageData.ToBytes());
var result = _predictor.Detect(image);
if (result != null)
{
    foreach (var box in result.Boxes)
    {
       //draw or do your work here
    }
}

should be easy to setup.

from yolov8.

dme-compunet avatar dme-compunet commented on June 21, 2024 1

Is this okay ?

Yes, it's only meant to pass configuration for a one prediction.

from yolov8.

GuenKainto avatar GuenKainto commented on June 21, 2024

@GuenKainto

using var predictor = YoloV8Builder.CreateDefaultBuilder()
                                   .UseOnnxModel("path/to/model.onnx")
                                   .WithConfiguration(configuration => 
                                   {
                                       configuration.Confidence = 3.5f,
                                       configuration.IoU = ...
                                   })
                                   .Build();

Thankyou for reply ^.^
and i found an another way

private static YoloV8Predictor predictor = YoloV8Predictor.Create(Path.Combine(Environment.CurrentDirectory, "Assets\model\best.onnx"));
public static async Task PredictAsync(Image image, float? iou, float? confidence)
{
YoloV8Configuration config = new YoloV8Configuration();
config.IoU = iou ?? 0.45f;
config.Confidence = confidence ?? 0.3f;
ImageSelector imageSelector = new(image);
var result = await predictor.DetectAsync(imageSelector, config);
return await result.PlotImageAsync(image);
}
Is this okay ?

from yolov8.

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.