![]() |
VOOZH | about |
dotnet add package YoloDotNet --version 4.2.0
NuGet\Install-Package YoloDotNet -Version 4.2.0
<PackageReference Include="YoloDotNet" Version="4.2.0" />
<PackageVersion Include="YoloDotNet" Version="4.2.0" />Directory.Packages.props
<PackageReference Include="YoloDotNet" />Project file
paket add YoloDotNet --version 4.2.0
#r "nuget: YoloDotNet, 4.2.0"
#:package YoloDotNet@4.2.0
#addin nuget:?package=YoloDotNet&version=4.2.0Install as a Cake Addin
#tool nuget:?package=YoloDotNet&version=4.2.0Install as a Cake Tool
Blazing-fast, production-ready YOLO inference for .NET
YoloDotNet is a modular, lightweight C# library for real-time computer vision and YOLO-based inference in .NET.
It provides high-performance inference for modern YOLO model families (YOLOv5u through YOLOv26, YOLO-World, YOLO-E, and RT-DETR), with explicit control over execution, memory, and preprocessing.
Built on .NET 8, ONNX Runtime, and SkiaSharp, YoloDotNet intentionally
avoids heavy computer vision frameworks such as OpenCV.
There is no Python runtime, no hidden preprocessing, and no implicit behavior —
only the components required for fast, predictable inference on Windows,
Linux, and macOS.
No Python. No magic. Just fast, deterministic YOLO — done properly for .NET.
👁 YOLOv5u
👁 YOLOv8-v26
👁 YOLO-RT-DETR
👁 YOLO-World
👁 YOLO-E
YoloDotNet is designed for developers who need:
Ideal for desktop apps, backend services, and real-time vision pipelines that require deterministic behavior and full control.
ToJson() — convert inference results to JSONSaveJson() — save inference results directly to a JSON fileToYoloFormat() — convert results to YOLO annotation formatSaveYoloFormat() — save results as YOLO-compatible training dataGetContourPoints() helper for extracting ordered contour points from segmented objects📖 Full release history:
See the demos
Practical, runnable examples showcasing YoloDotNet features are available in the demo projects:
👉
Using the correct opset ensures optimal compatibility and performance with ONNX Runtime.
For more information on how to export models to ONNX, refer to https://docs.ultralytics.com/modes/export/
Example export commands (Ultralytics CLI):
# For YOLOv5u–YOLOv12 (opset 17)
yolo export model=yolov8n.pt format=onnx opset=17
# For YOLOv26 (opset 18)
yolo export model=yolo26n.pt format=onnx opset=18
Model License Notice:
YoloDotNet is MIT licensed, but most Ultralytics YOLO models are AGPL-3.0 or require a commercial license for commercial use.
You are responsible for ensuring your use of any model complies with its license.
See Ultralytics Model Licensing for details.
dotnet add package YoloDotNet
# CPU (recommended starting point)
dotnet add package YoloDotNet.ExecutionProvider.Cpu
# Hardware-accelerated execution (choose one)
dotnet add package YoloDotNet.ExecutionProvider.Cuda
dotnet add package YoloDotNet.ExecutionProvider.OpenVino
dotnet add package YoloDotNet.ExecutionProvider.CoreML
dotnet add package YoloDotNet.ExecutionProvider.DirectML
💡 Note: The CUDA execution provider includes optional TensorRT acceleration.
No separate TensorRT package is required.
using SkiaSharp;
using YoloDotNet;
using YoloDotNet.Models;
using YoloDotNet.Extensions;
using YoloDotNet.ExecutionProvider.Cpu;
using var yolo = new Yolo(new YoloOptions
{
ExecutionProvider = new CpuExecutionProvider("model.onnx")
});
using var image = SKBitmap.Decode("image.jpg");
// Note: The IoU parameter is used for NMS-based models.
// For YOLOv10 and YOLOv26, IoU is ignored since post-processing is handled internally by the model.
var results = yolo.RunObjectDetection(image, confidence: 0.25, iou: 0.7);
image.Draw(results);
image.Save("result.jpg");
You’re now running YOLO inference in pure C#.
YOLO inference accuracy is not automatic.
Preprocessing settings such as image resize mode, sampling method, and confidence/IoU thresholds must match how the model was trained.
These settings directly control the accuracy–performance tradeoff and should be treated as part of the model itself.
📖 Before tuning models or comparing results, read:
👉
| Classification | Object Detection | OBB Detection | Segmentation | Pose Estimation |
|---|---|---|---|---|
| <img src="https://user-images.githubusercontent.com/35733515/297393507-c8539bff-0a71-48be-b316-f2611c3836a3.jpg" width=300> | <img src="https://user-images.githubusercontent.com/35733515/273405301-626b3c97-fdc6-47b8-bfaf-c3a7701721da.jpg" width=300> | <img src="https://github.com/NickSwardh/YoloDotNet/assets/35733515/d15c5b3e-18c7-4c2c-9a8d-1d03fb98dd3c" width=300> | <img src="https://github.com/NickSwardh/YoloDotNet/assets/35733515/3ae97613-46f7-46de-8c5d-e9240f1078e6" width=300> | <img src="https://github.com/NickSwardh/YoloDotNet/assets/35733515/b7abeaed-5c00-4462-bd19-c2b77fe86260" width=300> |
| <sub>pexels.com</sub> | <sub>pexels.com</sub> | <sub>pexels.com</sub> | <sub>pexels.com</sub> | <sub>pexels.com</sub> |
The following YOLO models have been tested and verified with YoloDotNet using official Ultralytics exports and default heads.
| Classification | Object Detection | Segmentation | Pose Estimation | OBB Detection |
|---|---|---|---|---|
| YOLOv8-cls<br>YOLOv11-cls<br>YOLOv12-cls<br>YOLOv26-cls | YOLOv5u<br>YOLOv8<br>YOLOv9<br>YOLOv10<br>YOLOv11<br>YOLOv12<br>YOLOv26<br>RT-DETR | YOLOv8-seg<br>YOLOv11-seg<br>YOLOv12-seg<br>YOLOv26-seg<br>YOLO-World (v2) | YOLOv8-pose<br>YOLOv11-pose<br>YOLOv12-pose<br>YOLOv26-pose | YOLOv8-obb<br>YOLOv11-obb<br>YOLOv12-obb<br>YOLOv26-obb<br> |
Hands-on examples are available in the demo folder:
👉
Includes image inference, video streams, GPU acceleration, segmentation, and large-image workflows.
| Provider | Windows | Linux | macOS | Documentation |
|---|---|---|---|---|
| CPU | ✅ | ✅ | ✅ | |
| CUDA / TensorRT | ✅ | ✅ | ❌ | |
| OpenVINO | ✅ | ✅ | ❌ | |
| CoreML | ❌ | ❌ | ✅ | |
| DirectML | ✅ | ❌ | ❌ |
ℹ️ Only one execution provider package may be referenced.
Mixing providers will cause native runtime conflicts.
YoloDotNet focuses on stable, low-overhead inference where runtime cost is dominated by the execution provider and model.
📊 Benchmarks:
Why this matters: fewer conflicts, predictable deployment, and production-safe behavior.
⭐ Star the repo
💬 Share feedback
🤝 Sponsor development
MIT License
Copyright (c) Niklas Swärd
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
YoloDotNet is licensed under the and provides an ONNX inference engine for YOLO models exported using Ultralytics YOLO tooling.
This project does not include, distribute, download, or bundle any pretrained models.
Users must supply their own ONNX models.
YOLO ONNX models produced using Ultralytics tooling are typically licensed under AGPL-3.0 or a separate commercial license from Ultralytics.
YoloDotNet does not impose, modify, or transfer any license terms related to user-supplied models.
Users are solely responsible for ensuring that their use of any model complies with the applicable license terms, including requirements related to commercial use, distribution, or network deployment.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 5 NuGet packages that depend on YoloDotNet:
| Package | Downloads |
|---|---|
|
Snet.Yolo.Server
识别组件:Server(Yolo多模型管理与智能识别服务,检测、定向检测、分类、分割、姿态) |
|
|
YoloDotNet.ExecutionProvider.Cpu
YoloDotNet.ExecutionProvider.Cpu provides a fully portable CPU-based execution provider for YoloDotNet using ONNX Runtime’s built-in CPU backend. This execution provider requires no additional system-level dependencies and works out of the box on Windows, Linux, and macOS. It is ideal for development, testing, CI environments, and production scenarios where GPU or NPU acceleration is unavailable. The CPU provider integrates seamlessly with YoloDotNet’s modular execution provider architecture introduced in v4.0 and supports all inference tasks including object detection, segmentation, classification, pose estimation, and OBB detection. |
|
|
YoloDotNet.ExecutionProvider.Cuda
CUDA and TensorRT execution provider for YoloDotNet, enabling GPU-accelerated inference on NVIDIA hardware using ONNX Runtime. This execution provider supports CUDA for general GPU acceleration and optional NVIDIA TensorRT integration for maximum performance, lower latency, and optimized engine execution. It is designed for high-throughput and real-time inference workloads on Windows and Linux systems with supported NVIDIA GPUs. The provider is fully compatible with the YoloDotNet core library and follows the new modular, execution-provider-agnostic architecture introduced in YoloDotNet v4.0. |
|
|
VL.YoloDotNet
YoloDotNet for VL |
|
|
YoloDotNet.ExecutionProvider.OpenVino
YoloDotNet OpenVINO Execution Provider enables optimized inference using Intel® OpenVINO™ on supported Intel CPUs, integrated GPUs, and accelerators. This execution provider integrates ONNX Runtime with Intel OpenVINO to deliver high-performance, low-latency inference on Intel hardware across Windows and Linux. It is ideal for CPU-focused deployments, edge systems, and environments where Intel hardware acceleration is preferred over CUDA-based solutions. The provider is fully modular and designed to work with the execution-provider-agnostic YoloDotNet core library introduced in v4.0. Only one execution provider should be referenced per project. |
Showing the top 1 popular GitHub repositories that depend on YoloDotNet:
| Repository | Stars |
|---|---|
|
Webreaper/Damselfly
Damselfly is a server-based Photograph Management app. The goal of Damselfly is to index an extremely large collection of images, and allow easy search and retrieval of those images, using metadata such as the IPTC keyword tags, as well as the folder and file names. Damselfly includes support for object/face detection.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 4.2.0 | 8,696 | 2/8/2026 |
| 4.1.0 | 1,094 | 1/17/2026 |
| 4.0.0 | 6,367 | 12/14/2025 |
| 3.1.1 | 8,470 | 7/31/2025 |
| 3.1.0 | 445 | 7/30/2025 |
| 3.0.0 | 877 | 7/15/2025 |
| 2.3.0 | 8,888 | 3/15/2025 |
| 2.2.0 | 11,124 | 10/13/2024 |
| 2.1.0 | 1,538 | 10/6/2024 |
| 2.0.0 | 4,008 | 7/12/2024 |
| 1.7.0 | 1,337 | 5/2/2024 |
| 1.6.0 | 736 | 4/4/2024 |
| 1.5.0 | 407 | 3/14/2024 |
| 1.4.0 | 2,648 | 3/6/2024 |
| 1.3.0 | 802 | 2/25/2024 |
| 1.2.0 | 476 | 2/5/2024 |
| 1.1.0 | 407 | 1/17/2024 |
| 1.0.0 | 597 | 12/8/2023 |
YoloDotNet v4.2 focuses on usability, ROI support, and segmentation enhancements.
This release adds Region of Interest (ROI) support, allowing inference on specific areas of an image or video stream — useful for surveillance, monitoring zones, and performance optimization.
New helper methods include ToJson() and SaveJson() for exporting results as JSON, ToYoloFormat() and SaveYoloFormat() for YOLO-annotated data export, and GetContourPoints() for extracting ordered contour points from segmented objects.
Segmentation now supports drawing edges on segmented objects.
Updated YOLOv26 inference execution to align with other tasks, improving consistency and overall execution efficiency.
Check out the demo projects on GitHub for hands-on examples: https://github.com/NickSwardh/YoloDotNet/tree/master/Demo