DeploySharp
Deploying deep learning models on multiple platforms (OpenVINO/ONNX Runtime, etc.)
Install / Use
/learn @guojin-yan/DeploySharpREADME
%20%F0%9F%92%9E%20&forks=1&issues=1&logo=https%3A%2F%2Fs2.loli.net%2F2023%2F01%2F26%2FylE1K5JPogMqGSW.png&name=1&owner=1&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Light)
简体中文| English
📚 Introduction
DeploySharp is a cross-platform model deployment framework designed for C# developers, offering end-to-end solutions from model loading and configuration management to inference execution. Its modular namespace architecture significantly reduces the complexity of integrating deep learning models into the C# ecosystem.
1. Architecture & Layered Design
- Root namespace
DeploySharpserves as a unified entry point for core features (model loading, inference, etc.). - Modular sub-namespaces (e.g.,
DeploySharp.Engine) enable clear functional layers. - Generic class designs support standard data interfaces for tasks like image processing/classification/detection.
2. Multi-Engine Support
- Native integration with OpenVINO (
OpenVinoSharp) and ONNX Runtime. - Compatibility with YOLOv5-v12 models, Anomalib, and other mainstream architectures.
3. Cross-Platform Runtime
- Supports .NET Framework 4.8+ and .NET 6/7/8/9.
- Deep integration with .NET NuGet ecosystem.
4. High-Performance Inference
- Asynchronous operations (
System.Threading.Tasks). - Batch/single-image inference modes.
- Rich pre-/post-processing (ImageSharp/OpenCvSharp).
5. Developer Support
- Bilingual (EN/CN) code comments and documentation.
log4netlogging (error/warning/debug levels).- Visualization tools and comprehensive code samples.
Licensed under Apache License 2.0. Future updates will expand TensorRT support and optimize heterogenous computing.
📄Technical Blog
🎨Supported Models
| Model Name | Model Type | OpenVINO | ONNX Runtime | TensorRT | | :----------: | :---------------------: | :------: | :----------: | :------: | | YOLOv5 | Detection | ✅ | ✅ | ✅ | | YOLOv5 | Segmentation | ✅ | ✅ | ✅ | | YOLOv6 | Detection | ✅ | ✅ | ✅ | | YOLOv7 | Detection | ✅ | ✅ | ✅ | | YOLOv8 | Detection | ✅ | ✅ | ✅ | | YOLOv8 | Segmentation | ✅ | ✅ | ✅ | | YOLOv8 | Pose | ✅ | ✅ | ✅ | | YOLOv8 | Oriented Bounding Boxes | ✅ | ✅ | ✅ | | YOLOv9 | Detection | ✅ | ✅ | ✅ | | YOLOv9 | Segmentation | ✅ | ✅ | ✅ | | YOLOv10 | Detection | ✅ | ✅ | ✅ | | YOLOv11 | Detection | ✅ | ✅ | ✅ | | YOLOv11 | Segmentation | ✅ | ✅ | ✅ | | YOLOv11 | Pose | ✅ | ✅ | ✅ | | YOLOv11 | Oriented Bounding Boxes | ✅ | ✅ | ✅ | | YOLOv12 | Detection | ✅ | ✅ | ✅ | | Anomalib | Segmentation | ✅ | ✅ | ✅ | | PP-YOLOE | Detection | ✅ | ✅ | ✅ | | DEIMv2 | Detection | ✅ | ✅ | ✅ | | RFDETR | Detection | ✅ | ✅ | ✅ | | RFDETR | Segmentation | ✅ | ✅ | ✅ | | RTDETR | Detection | ✅ | ✅ | ✅ | | YOLO26 | Detection | ✅ | ✅ | ✅ | | YOLO26 | Segmentation | ✅ | ✅ | ✅ | | YOLO26 | Pose | ✅ | ✅ | ✅ | | YOLO26 | Oriented Bounding Boxes | ✅ | ✅ | ✅ | | PP-OCR v5 | Detection | ✅ | ✅ | ✅ | | PP-OCR v5 | Classification | ✅ | ✅ | ✅ | | PP-OCR v5 | Recognize | ✅ | ✅ | ✅ | | PP-OCR v5 | Det+Cls+Rec | ✅ | ✅ | ✅ | | PP-OCR v4 | Detection | ✅ | ✅ | ✅ | | PP-OCR v4 | Classification | ✅ | ✅ | ✅ | | PP-OCR v4 | Recognize | ✅ | ✅ | ✅ | | PP-OCR v4 | Det+Cls+Rec | ✅ | ✅ | ✅ |
<img title="NuGet" src="https://s2.loli.net/2023/08/08/jE6BHu59L4WXQFg.png" alt="" width="40">NuGet Package
Core Managed Libraries
| Package | Description | Link |
| --------------------- | ------------------------------ | ------------------------------------------------------------ |
| JYPPX.DeploySharp | DeploySharp API core libraries | |
Native Runtime Libraries
| Package | Description | Link |
| --------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| JYPPX.DeploySharp.ImageSharp | An assembly that uses ImageSharp as an image processing tool. | |
| JYPPX.DeploySharp.OpenCvSharp | An assembly that uses OpenCvSharp as an image processing tool. |
|
⚙ Installation
DeploySharp includes image processing methods such as OpenCvSharp and ImageSharp, as well as support for OpenVINO and ONNX Runtime model deployment engines. Therefore, users can combine them according to their own needs and install the corresponding VNet Package to use them out of the box. The following summarizes some commonly used scenarios for installing VNet Package:
- OpenVINO inference+OpenCvSharp image processing
JYPPX.DeploySharp
JYPPX.DeploySharp.OpenCvSharp
OpenVINO.runtime.win
OpenCvSharp4.runtime.win
- OpenVINO inference+ImageSharp image processing
JYPPX.DeploySharp
JYPPX.DeploySharp.ImageSharp
OpenVINO.runtime.win
- ONNX Runtime inference+OpenCvSharp image processing
JYPPX.DeploySharp
JYPPX.DeploySharp.OpenCvSharp
OpenCvSharp4.runtime.win
- **ONNX Runtime inference+ImageSharp image processing **
JYPPX.DeploySharp
JYPPX.DeploySharp.OpenCvSharp
- ONNX Runtime(OpenVINO) inference+ImageSharp image processing
JYPPX.DeploySharp
JYPPX.DeploySharp.ImageSharp
Intel.ML.OnnxRuntime.OpenVino
- ONNX Runtime(DML) inference+ImageSharp image processing
JYPPX.DeploySharp
JYPPX.DeploySharp.ImageSharp
Microsoft.ML.OnnxRuntime.DirectML
- ONNX Runtime(CUDA) inference+ImageSharp image processing
JYPPX.DeploySharp
JYPPX.DeploySharp.ImageSharp
Microsoft.ML.OnnxRuntime.DirectML
Due to the influence of GPU device model and software version on using CUDA to accelerate ONNX Runtime, it is necessary to download and use according to the official version correspondence provided by ONNX Runtime. Please refer to the following link for the correspondence between ONNX Runtime, CUDA, and cuDNN:
https://runtime.onnx.org.cn/docs/execution-providers/CUDA-ExecutionProvider.html#requirements
The usage methods listed above can all be installed with just one click through the VNet Package. Similarly, ONNX Runtime also supports more acceleration methods, but users need to build their own code. For the construction process and method, please refer to the official tutorial. The link is:
https://runtime.onnx.org.cn/docs/execution-providers/
🏷 Quick Start
If you don't know how to use it, use the following code to briefly understand how to use it.
ImageSharp
using DeploySharp.Data;
using DeploySharp.Engine;
using DeploySharp.Model;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
using System;
namespace DeploySharp.ImageSharp.Demo
{
public class YOLOv5DetDemo
{
public static void Run()
{
//The model and test images can be downloaded from the QQ group (945057948)
//Replace the following model path with your own model path
string modelP
Related Skills
tmux
349.7kRemote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
diffs
349.7kUse the diffs tool to produce real, shareable diffs (viewer URL, file artifact, or both) instead of manual edit summaries.
terraform-provider-genesyscloud
Terraform Provider Genesyscloud
blogwatcher
349.7kMonitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.
