JYPPX.DeploySharp.Backend.OpenCV
2.0.0-alpha.1
dotnet add package JYPPX.DeploySharp.Backend.OpenCV --version 2.0.0-alpha.1
NuGet\Install-Package JYPPX.DeploySharp.Backend.OpenCV -Version 2.0.0-alpha.1
<PackageReference Include="JYPPX.DeploySharp.Backend.OpenCV" Version="2.0.0-alpha.1" />
<PackageVersion Include="JYPPX.DeploySharp.Backend.OpenCV" Version="2.0.0-alpha.1" />
<PackageReference Include="JYPPX.DeploySharp.Backend.OpenCV" />
paket add JYPPX.DeploySharp.Backend.OpenCV --version 2.0.0-alpha.1
#r "nuget: JYPPX.DeploySharp.Backend.OpenCV, 2.0.0-alpha.1"
#:package JYPPX.DeploySharp.Backend.OpenCV@2.0.0-alpha.1
#addin nuget:?package=JYPPX.DeploySharp.Backend.OpenCV&version=2.0.0-alpha.1&prerelease
#tool nuget:?package=JYPPX.DeploySharp.Backend.OpenCV&version=2.0.0-alpha.1&prerelease
<picture> <source media="(prefers-color-scheme: dark)" srcset="docs/images/readme/hero-dark.svg"> <source media="(prefers-color-scheme: light)" srcset="docs/images/readme/hero-light.svg"> <img alt="DeploySharp - reproducible AI inference workflows for .NET" src="docs/images/readme/hero-light.svg" width="100%"> </picture>
<p align="center">A modular .NET model deployment toolkit for reproducible vision, language, and multimodal inference across replaceable backends.</p>
<p align="center"> <a href="https://github.com/guojin-yan/DeploySharp/actions/workflows/ci.yml?query=branch%3ADeploySharpV2.0"><img src="https://github.com/guojin-yan/DeploySharp/actions/workflows/ci.yml/badge.svg?branch=DeploySharpV2.0" alt="Windows CI" /></a> <a href="https://github.com/guojin-yan/DeploySharp/blob/DeploySharpV2.0/LICENSE.txt"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="Apache-2.0 license" /></a> <a href="https://github.com/guojin-yan/DeploySharp/stargazers"><img src="https://img.shields.io/github/stars/guojin-yan/DeploySharp?style=flat&label=stars" alt="GitHub stars" /></a> <a href="https://dotnet.microsoft.com/"><img src="https://img.shields.io/badge/.NET-net46%20to%20net10.0-512BD4" alt=".NET Framework 4.6 through .NET 10" /></a> <a href="docs/articles/platform-support.md"><img src="https://img.shields.io/badge/platform-Windows%20x64%20Alpha-0078D4" alt="Windows x64 Alpha" /></a> </p>
<p align="center"> <a href="docs/index.md"><img src="https://img.shields.io/badge/docs-DocFX-2f80ed" alt="DocFX documentation" /></a> <a href="docs/releases/2.0.0-alpha.1.md"><img src="https://img.shields.io/badge/release-2.0.0--alpha.1-f59e0b" alt="DeploySharp 2.0.0-alpha.1" /></a> <a href="https://github.com/guojin-yan/DeploySharp/releases"><img src="https://img.shields.io/github/v/release/guojin-yan/DeploySharp?include_prereleases&label=GitHub%20Release" alt="GitHub Release" /></a> </p>
<p align="center"><strong>English</strong> | <a href="README_cn.md">简体中文</a></p>
DeploySharp
DeploySharp V2 provides explicit contracts for model artifacts, typed tensors, sessions, visual pipelines, language/multimodal workflows, ModelPack integrity, ModelFactory acquisition, and replaceable inference backends. Applications own model files and native runtimes; DeploySharp keeps backend selection and execution boundaries visible.
📖 Introduction
- Stable application contracts: model identity, typed tensors, named inputs/outputs, sessions, diagnostics, cancellation, and disposal.
- Complete inference workflows: classification, detection, segmentation, pose, OBB, OCR, anomaly, promptable segmentation, vision-language, LLM, and multimodal paths.
- Explicit backend ownership: ONNX Runtime, OpenVINO, OpenCV DNN, TensorRT/CUDA, and LLamaSharp adapters without silently installing every vendor runtime.
- Reproducible model delivery: ModelPack manifests, artifact size/SHA-256 checks, versioned Release downloads, offline cache reuse, and a runnable model case.
The V2 API is a clean redesign and does not provide V1 source, binary, configuration, or behavior compatibility.
✨ Release Highlights
- Core, Visual, LLM, Multimodal, ModelPack, ModelFactory, five backend families, and seven grouped sample modules.
- The model catalog, model/backend verification matrix, and named-device measurements are maintained as public documents.
- Windows x64 verification for ONNX Runtime, OpenVINO, OpenCV DNN, and named TensorRT/CUDA environments.
- Session pools, batching, asynchronous visual inference, sliding-window detection, and repeatable benchmark tooling.
📢 Latest Update: 2.0.0-alpha.1
<code>2.0.0-alpha.1</code> is the first DeploySharp V2 engineering preview, focused on source-first Windows 10/11 x64 reproduction while the public API and package surface settle. The complete scope and known boundaries are in the release notes.
🚀 Get Started In 30 Seconds
Install the Core layer and the backend you need at the same version. Source-first reproduction can use project references from this repository.
dotnet add package JYPPX.DeploySharp.Core --version 2.0.0-alpha.1
dotnet add package JYPPX.DeploySharp.Backend.OnnxRuntime --version 2.0.0-alpha.1
dotnet add package Microsoft.ML.OnnxRuntime --version 1.28.0
Create a model artifact, register ONNX Runtime, create a named-tensor session, and run one typed input:
using System.Threading;
using JYPPX.DeploySharp;
using JYPPX.DeploySharp.Backends.OnnxRuntime;
using JYPPX.DeploySharp.Models;
using JYPPX.DeploySharp.Registry;
using JYPPX.DeploySharp.Tensors;
using var backends = new BackendRegistry();
backends.UseOnnxRuntime();
var artifact = new ModelArtifact(
new ModelId("examples/classifier"),
"onnx",
@"models\classifier.onnx",
preferredBackend: OnnxRuntimeBackendProvider.BackendId);
var request = new BackendRequest(
BackendCapabilities.TensorInference,
OnnxRuntimeBackendProvider.BackendId,
"cpu");
using IInferenceSession session = backends.CreateSession(
artifact, request, SessionOptions.Default);
var input = new Tensor<float>(new TensorShape(1, 3), new[] { 0.1f, 0.2f, 0.7f });
InferenceOutputs outputs = session.Run(InferenceInputs.Create("images", input), CancellationToken.None);
Console.WriteLine(outputs.Count);
The code-first path, visual preparation, ModelFactory download flow, and model-specific examples are in the usage tutorial and samples.
📦 Package Layout
| Package family | Contents | Native runtime ownership |
|---|---|---|
| <code>JYPPX.DeploySharp.Core</code> | Models, tensors, sessions, results, diagnostics, backend registration | None |
| <code>JYPPX.DeploySharp.Extensibility</code> | Plugin descriptors, runtime dependencies, options schemas, and native probes | None; host-owned probing |
| <code>JYPPX.DeploySharp.Visual</code> | Visual profiles, preprocessing metadata, decoders, canonical results | None |
| <code>JYPPX.DeploySharp.Visual.OpenCV</code> | OpenCV image loading and tensor preparation | Application selects OpenCV runtime |
| <code>JYPPX.DeploySharp.Visual.TensorRT</code> | CUDA preprocessing and device-resident TensorRT visual pipelines | Application provides TensorRT, CUDA, bridge, and engine |
| <code>JYPPX.DeploySharp.LLM</code> / <code>Multimodal</code> | Generation, chat, embeddings, ordered media, streaming | Application selects model runtime |
| <code>JYPPX.DeploySharp.ModelPack.Json</code> / <code>ModelFactory</code> | Manifests, integrity validation, catalog downloads, offline cache | None; model files stay application-owned |
| <code>JYPPX.DeploySharp.Backend.*</code> | ONNX Runtime, OpenVINO, OpenCV DNN, TensorRT, and LLamaSharp adapters | Backend-specific and explicit |
Recommended Package Combinations
| Scenario | DeploySharp packages | Application-owned runtime |
|---|---|---|
| ONNX Runtime visual inference | Core + Visual + Visual.OpenCV + Backend.OnnxRuntime |
ONNX Runtime CPU/CUDA package and model files |
| OpenVINO or OpenCV DNN visual inference | Core + Visual + Visual.OpenCV + the matching Backend.* |
Matching OpenVINO/OpenCV native runtime |
| TensorRT CUDA visual inference | Core + Visual + Visual.TensorRT + Backend.TensorRT |
CUDA, cuDNN, TensorRT, bridge, and compatible Engine |
| LLM or multimodal inference | Core + LLM or Multimodal + the selected backend |
GGUF/model files and selected native runtime |
| Model catalog/cache and plugin probing | Core + ModelPack.Json + ModelFactory and/or Extensibility |
Application-owned catalog, cache, and probe host |
See the detailed package combination and installation guide for commands, TFM/RID notes, and runtime ownership.
🌐 Public Packages And Release Assets
DeploySharp packages are not yet published to nuget.org. The exact package IDs and 2.0.0-alpha.1 candidate version remain visible here; each NuGet badge points to its real package page and will show the published version automatically after the first release.
| Publication channel | Current status | Assets |
|---|---|---|
| NuGet.org | DeploySharp packages await their first publication | Public managed package feed |
| GitHub Packages | DeploySharp packages await their first publication | Package mirror |
| GitHub Releases | Used for model artifact delivery | Immutable ModelPack assets and verification metadata |
Default Test Images
Examples and benchmark tools use the dedicated test-assets.1 release when no local image is supplied. The task defaults are bus.jpg for detection/segmentation, demo_7.jpg for classification, demo_9.jpg for pose, plane.png for oriented detection, and ocr-demo_1.jpg for PaddleOCR. Files are SHA-256 verified and cached under %LOCALAPPDATA%\DeploySharp\TestImages; the full mapping and maintenance commands are in the default test images guide.
Application-Owned Runtime Packages
These are application dependencies/runtime packages used by the Windows Alpha. Referencing a DeploySharp managed package does not silently install them:
| Package | NuGet | Purpose |
|---|---|---|
| Microsoft.ML.OnnxRuntime | ONNX Runtime CPU native execution | |
| JYPPX.OpenCV.runtime.win-x64 | Windows x64 OpenCV native runtime | |
| OpenVINO.runtime.win | Windows OpenVINO native runtime | |
| JYPPX.TensorRT.CSharp.API | Managed TensorRT/CUDA API; NVIDIA libraries remain application-installed | |
| LLamaSharp.Backend.Cpu | CPU native backend for LLamaSharp GGUF workflows |
The managed package tables do not mean native dependencies are installed automatically. See installation and runtime ownership before selecting a deployment RID.
🖥️ Platforms And Frameworks
| Platform | Build/package boundary | Inference verification |
|---|---|---|
| Windows 10 x64 | Alpha support | ONNX Runtime, OpenVINO, OpenCV DNN CPU; named TensorRT GPU evidence |
| Windows 11 x64 | Alpha support | Same code path; named-device evidence is recorded separately |
| Windows ARM64, Linux, macOS, mobile, NPU | No Alpha inference claim | Not yet verified for this release |
The complete framework list and backend evidence are in platform and backend support. Build compatibility is not the same as inference verification.
🤖 Supported Models
The catalog covers YOLO, DETR, PaddleOCR v5 Preview, PaDiM, BRIA RMBG, SAM, CLIP, BLIP, and Qwen GGUF. PaddleOCR v4/v6 also have local pipeline evidence but are not presented as downloadable catalog entries. Use the model support guide for catalog IDs and the model/backend matrix for current backend cells.
🧪 Example Series
| Module | Demonstration |
|---|---|
| <code>01-core</code> | Backend-neutral model/tensor lifecycle |
| <code>02-visual</code> | Visual profiles, preprocessing metadata, asynchronous inference, and sliding-window detection |
| <code>03-backends</code> | Native backend loading and named-tensor execution |
| <code>04-multimodal</code> | Ordered media, streaming, cancellation, and cleanup |
| <code>05-llm</code> | Conversation history and prompt formatting |
| <code>06-models</code> | Catalog selection, model cases, Release download/inference |
| <code>07-benchmarks</code> | Same-model backend/platform latency and throughput |
See the sample learning path.
📚 Documentation
| Resource | Link | Purpose |
|---|---|---|
| Documentation index | docs/index.md | Public DocFX entry point |
| First release notes | 2.0.0-alpha.1 | Release scope and known boundaries |
| Usage tutorial | Usage tutorial | Code-first tensor and visual workflows |
| Platform/backend support | Support table | Target framework and verification boundaries |
| Model support | Model guide | Catalog IDs, families, and status semantics |
| Device measurements | Named-device results | Reproducible environment and timing records |
🔨 Build From Source
dotnet restore DeploySharp.sln --locked-mode
dotnet build DeploySharp.sln -c Release --no-restore
dotnet test DeploySharp.sln -c Release --no-build --no-restore
⚖️ License
DeploySharp source code is licensed under the Apache License 2.0. Models and vendor runtimes are separate artifacts with their own runtime and distribution terms.
🤝 Contact And Sponsorship
For questions, issue reports, testing feedback, or sponsorship, please use the project homepage and issue tracker.
<p align="center"> <img src="docs/images/readme/contact-support-en.png" width="100%" alt="Developer contact channels, community entry points, and sponsorship QR codes"> </p>
⚠️ Software Notice And Disclaimer
📜 1. Open Source License Notice
All open-source project code authored by the project author follows the Apache License 2.0.
Special note: This project integrates several third-party libraries. If any third-party library uses a license that conflicts with or differs from Apache 2.0, the original license of that third-party library takes precedence. This project does not include or represent the license notices of those third-party libraries. Read and comply with the relevant third-party licenses before use.
🤖 2. Code Development And Quality Notice
- AI-assisted development: AI assistance was used to generate and improve parts of this code during development; it was not written entirely line by line by a human.
- Security statement: The author solemnly declares that this code contains no intentionally planted backdoors, viruses, Trojans, or malicious code intended to damage user devices or steal data.
- Technical limitations: Due to the author's technical level and capabilities, the code may contain basic issues caused by insufficiently rigorous logic, incomplete optimization, or limited experience, including but not limited to memory leaks, occasional crashes, and unreleased resources. These issues are the result of limitations in ability and are not intentional.
- Testing scope: Because the author's time is limited, this software has not been fully tested across every scenario and edge case.
🚨 3. Important Disclaimer
Before applying this code to any real-world project, especially a commercial, industrial, or mission-critical environment, you must perform thorough and rigorous independent testing and validation. In view of the possible defects and limited test coverage described above, the author accepts no responsibility for any direct or indirect loss caused by using this code, including but not limited to equipment failure, data loss, system outage, or loss of profits. By using this code, you acknowledge these risks and agree to bear all consequences independently; related issues are not the responsibility of the author.
🔓 4. Scope Of Open Source Code
The core logic of this project is fully open source. However, the binary files, source code, and related resources of the third-party libraries mentioned above are outside this project's open-source obligations. Obtain and use them according to their respective instructions and licenses.
🤝 5. Community And Feedback
Despite these limitations, everyone is welcome to download and use the project, submit Issues, and participate in testing. If you find a bug, memory overflow, or improvement opportunity, please use the contact channels on the project homepage. We will do our best to provide assistance within the time available.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.1 is compatible. |
| .NET Framework | net46 is compatible. net461 is compatible. net462 is compatible. net463 was computed. net47 is compatible. net471 is compatible. net472 is compatible. net48 is compatible. net481 is compatible. |
-
.NETCoreApp 3.1
- JYPPX.DeploySharp.Core (>= 2.0.0-alpha.1)
- JYPPX.DeploySharp.Extensibility (>= 2.0.0-alpha.1)
- JYPPX.OpenCV.CSharp.API (>= 5.0.0-preview.1)
-
.NETFramework 4.6
- JYPPX.DeploySharp.Core (>= 2.0.0-alpha.1)
- JYPPX.DeploySharp.Extensibility (>= 2.0.0-alpha.1)
- JYPPX.OpenCV.CSharp.API (>= 5.0.0-preview.1)
-
.NETFramework 4.6.1
- JYPPX.DeploySharp.Core (>= 2.0.0-alpha.1)
- JYPPX.DeploySharp.Extensibility (>= 2.0.0-alpha.1)
- JYPPX.OpenCV.CSharp.API (>= 5.0.0-preview.1)
-
.NETFramework 4.6.2
- JYPPX.DeploySharp.Core (>= 2.0.0-alpha.1)
- JYPPX.DeploySharp.Extensibility (>= 2.0.0-alpha.1)
- JYPPX.OpenCV.CSharp.API (>= 5.0.0-preview.1)
-
.NETFramework 4.7
- JYPPX.DeploySharp.Core (>= 2.0.0-alpha.1)
- JYPPX.DeploySharp.Extensibility (>= 2.0.0-alpha.1)
- JYPPX.OpenCV.CSharp.API (>= 5.0.0-preview.1)
-
.NETFramework 4.7.1
- JYPPX.DeploySharp.Core (>= 2.0.0-alpha.1)
- JYPPX.DeploySharp.Extensibility (>= 2.0.0-alpha.1)
- JYPPX.OpenCV.CSharp.API (>= 5.0.0-preview.1)
-
.NETFramework 4.7.2
- JYPPX.DeploySharp.Core (>= 2.0.0-alpha.1)
- JYPPX.DeploySharp.Extensibility (>= 2.0.0-alpha.1)
- JYPPX.OpenCV.CSharp.API (>= 5.0.0-preview.1)
-
.NETFramework 4.8
- JYPPX.DeploySharp.Core (>= 2.0.0-alpha.1)
- JYPPX.DeploySharp.Extensibility (>= 2.0.0-alpha.1)
- JYPPX.OpenCV.CSharp.API (>= 5.0.0-preview.1)
-
.NETFramework 4.8.1
- JYPPX.DeploySharp.Core (>= 2.0.0-alpha.1)
- JYPPX.DeploySharp.Extensibility (>= 2.0.0-alpha.1)
- JYPPX.OpenCV.CSharp.API (>= 5.0.0-preview.1)
-
net10.0
- JYPPX.DeploySharp.Core (>= 2.0.0-alpha.1)
- JYPPX.DeploySharp.Extensibility (>= 2.0.0-alpha.1)
- JYPPX.OpenCV.CSharp.API (>= 5.0.0-preview.1)
- OnnxSharp (>= 0.3.2)
-
net5.0
- JYPPX.DeploySharp.Core (>= 2.0.0-alpha.1)
- JYPPX.DeploySharp.Extensibility (>= 2.0.0-alpha.1)
- JYPPX.OpenCV.CSharp.API (>= 5.0.0-preview.1)
-
net6.0
- JYPPX.DeploySharp.Core (>= 2.0.0-alpha.1)
- JYPPX.DeploySharp.Extensibility (>= 2.0.0-alpha.1)
- JYPPX.OpenCV.CSharp.API (>= 5.0.0-preview.1)
-
net7.0
- JYPPX.DeploySharp.Core (>= 2.0.0-alpha.1)
- JYPPX.DeploySharp.Extensibility (>= 2.0.0-alpha.1)
- JYPPX.OpenCV.CSharp.API (>= 5.0.0-preview.1)
-
net8.0
- JYPPX.DeploySharp.Core (>= 2.0.0-alpha.1)
- JYPPX.DeploySharp.Extensibility (>= 2.0.0-alpha.1)
- JYPPX.OpenCV.CSharp.API (>= 5.0.0-preview.1)
- OnnxSharp (>= 0.3.2)
-
net9.0
- JYPPX.DeploySharp.Core (>= 2.0.0-alpha.1)
- JYPPX.DeploySharp.Extensibility (>= 2.0.0-alpha.1)
- JYPPX.OpenCV.CSharp.API (>= 5.0.0-preview.1)
- OnnxSharp (>= 0.3.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0-alpha.1 | 67 | 9/6/2026 |