Blazing-fast, production-ready YOLO inference for .NET
YoloDotNet is a fully featured C# library for real-time computer vision using YOLOv5uβv12, YOLO-World, and YOLO-E models.
Built on .NET 8 and ONNX Runtime, it delivers high-performance, predictable inference on Windows, Linux, and macOS β with explicit control over execution, memory, and preprocessing.
No Python. No magic. Just fast, deterministic YOLO β done properly for .NET.
YoloDotNet is designed for developers who need:
- β Pure .NET β no Python runtime, no scripts
- β Real performance β CPU, CUDA / TensorRT, OpenVINO, CoreML
- β Explicit configuration β predictable accuracy and memory usage
- β Production readiness β engine caching, long-running stability
- β Large image support β not limited to toy resolutions
- β Multiple vision tasks β detection, OBB, segmentation, pose, classification
Ideal for desktop apps, backend services, and real-time vision pipelines that require deterministic behavior and full control.
- Modular execution providers (CPU, CUDA/TensorRT, OpenVINO, CoreML)
- New OpenVINO and CoreML providers
- Cleaner dependency graph
- Improved GPU behavior and predictability
- Grayscale ONNX model support
π Full release history: CHANGELOG.md
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π‘ Note: The CUDA execution provider includes optional TensorRT acceleration.
No separate TensorRT package is required.
using SkiaSharp;
using YoloDotNet;
using YoloDotNet.ExecutionProvider.Cpu;
using var yolo = new Yolo(new YoloOptions
{
ExecutionProvider = new CpuExecutionProvider("model.onnx")
});
using var image = SKBitmap.Decode("image.jpg");
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:
π Accuracy & Configuration Guide
| Classification | Object Detection | OBB Detection | Segmentation | Pose Estimation |
|---|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
| pexels.com | pexels.com | pexels.com | pexels.com | pexels.com |
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 | β | β | β | CPU README |
| CUDA / TensorRT | β | β | β | CUDA README |
| OpenVINO | β | β | β | OpenVINO README |
| CoreML | β | β | β | CoreML README |
βΉοΈ 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: /test/YoloDotNet.Benchmarks
- Stable latency after warm-up
- Clean scaling from CPU β GPU β TensorRT
- Predictable allocation behavior
- Suitable for real-time and long-running services
- Core package is provider-agnostic
- Execution providers are separate NuGet packages
- Native ONNX Runtime dependencies are isolated
Why this matters: fewer conflicts, predictable deployment, and production-safe behavior.
β Star the repo
π¬ Share feedback
π€ Sponsor development
Β© 2023β2025 Niklas SwΓ€rd
Licensed under GPL v3.0 or later.
See LICENSE for full details.




