百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
Y

YoloSharp

> 编程语言
开源

基于 ONNX-Runtime 的高性能实时物体检测解决方案 YOLO11 ⚡️

561 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

基于 ONNX-Runtime 的高性能实时物体检测解决方案 YOLO11 ⚡️

YoloSharp

A high performance real-time object detection solution using YOLO11 ⚡️ powered by ONNX-Runtime

Features

  • YOLO Tasks Support for all YOLO vision tasks ( Detect | OBB | Pose | Segment | Classify)
  • High Performance Various techniques and use of .NET features to maximize performance
  • Reduced Memory Usage By reusing memory blocks and reducing the pressure on the GC
  • Plotting Options ✏️ Draw the predictions on the target image to preview the model results
  • YOLO Versions Includes support for: YOLOv8 YOLOv10 YOLO11 YOLO12 YOLO26

Installation

The project provides the following NuGet packages:

Package Description Dependencies
YoloSharp CPU-based inference Includes all runtime dependencies (all platforms)
YoloSharp.Gpu GPU-based inference Includes all runtime dependencies (all platforms)
YoloSharp.Core Core library without runtime dependencies None – suitable for lightweight production or for using alternative runtimes

Usage

1. Export model to ONNX format:

For convert the pre-trained PyTorch model to ONNX format, run the following Python code:

python
from ultralytics import YOLO

# Load a model
model = YOLO('path/to/best.pt')

# Export the model to ONNX format
model.export(format='onnx')

2. Load the ONNX model with C#:

Add the YoloSharp (or YoloSharp.Gpu) package to your project:

bash
dotnet add package YoloSharp

Use the following C# code to load the model and run basic prediction:

csharp
using Compunet.YoloSharp;

// Load the YOLO predictor
using var predictor = new YoloPredictor("path/to/model.onnx");

// Run model
var result = predictor.Detect("path/to/image.jpg");
// or
var result = await predictor.DetectAsync("path/to/image.jpg");

// Write result summary to terminal
Console.WriteLine(result);

Plotting

You can to plot the target image for preview the model results, this code demonstrates how to run a inference, plot the results on image and save to file:

csharp
using Compunet.YoloSharp;
using Compunet.YoloSharp.Plotting;
using SixLabors.ImageSharp;

// Load the YOLO predictor
using var predictor = new YoloPredictor("path/to/model.onnx");

// Load the target image
using var image = Image.Load("path/to/image");

// Run model
var result = await predictor.PoseAsync(image);

// Create plotted image from model results
using var plotted = await result.PlotImageAsync(image);

// Write the plotted image to file
plotted.Save("./pose_demo.jpg");

You can also predict and save to file in one operation:

csharp
using Compunet.YoloSharp;
using Compunet.YoloSharp.Plotting;
using SixLabors.ImageSharp;

// Load the YOLO predictor
using var predictor = new YoloPredictor("path/to/model.onnx");

// Run model, plot predictions and write to file
predictor.PredictAndSaveAsync("path/to/image");

Example Images:

Detect Pose
Segment Obb

Not Supported:

The following features are not currently supported, they may be added later

  • Batch Processing: You have to predict them one by one
  • Dynamic Size: The image resized according to imgsz

License

AGPL-3.0 License

Important Note: This project depends on ImageSharp, you should check the license details here

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#csharpdotnetimage-classificationimagesharp

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言