c# 调用yolosharp实现目标及关键点检测
·
onnxruntime下推理yolo实在是太麻烦,代码量也大,最近发现yolosharp真的很好用


这是代码推理效果
using Compunet.YoloSharp;
using Compunet.YoloSharp.Plotting;
using SixLabors.ImageSharp;
// Load the YOLO predictor
using var predictor = new YoloPredictor("Desktop/yolo26n.onnx");
// Load the target image
using var image = Image.Load("Desktop/111.png");
// Run model
var result = await predictor.DetectAsync(image); //这里可以修改 pose 和segment用于分割和关键点检测
// Create plotted image from model results
using var plotted = await result.PlotImageAsync(image);
// Write the plotted image to file
plotted.Save("Desktop/112.jpg");
Console.WriteLine(result);
更多推荐




所有评论(0)