ZeroInference.Core 1.0.0

dotnet add package ZeroInference.Core --version 1.0.0
                    
NuGet\Install-Package ZeroInference.Core -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ZeroInference.Core" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZeroInference.Core" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="ZeroInference.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ZeroInference.Core --version 1.0.0
                    
#r "nuget: ZeroInference.Core, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ZeroInference.Core@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ZeroInference.Core&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=ZeroInference.Core&version=1.0.0
                    
Install as a Cake Tool

ZeroInference

License: MIT .NET Multi-Targeting ONNX Support Zero External Dependencies NuGet Version

ZeroInference is a pure C# ONNX deep learning inference engine and model runtime for .NET with zero external dependencies. It eliminates bulky native C++ runtime binaries (no ONNX Runtime native DLLs, no OpenVINO, no Python dependencies), reading and evaluating .onnx and .zeromodel neural graphs directly in memory with SIMD vectorization and int8 quantization.


๐ŸŒŸ Key Capabilities

  • Zero Dependency Pure C# Runtime: No native shared libraries (onnxruntime.dll, libonnxruntime.so) required. Runs anywhere .NET runs.
  • Direct ONNX Model Parser: Stack-allocated Protocol Buffers wire reader (ProtobufWireReader) parsing ONNX binary graphs directly into executable compute graphs.
  • Compact .zeromodel Serialization: Fast binary serialization format with pre-compiled layer topologies and optimized weights layout.
  • Supported Deep Learning Layers:
    • Conv2D (Direct & im2col GEMM convolution)
    • Dense / Gemm (Fully-connected linear layers)
    • BatchNormalization & LayerNorm
    • Activations (ReLU, LeakyReLU, Sigmoid, Tanh, Softmax)
    • Pooling (MaxPool2D, AveragePool2D, GlobalAveragePool)
    • Reshape, Flatten, Concat, Slice
  • Quantization & Vision Post-Processing:
    • Int8 Quantizer: Symmetric and asymmetric integer quantization for edge devices.
    • Non-Maximum Suppression (NMS): Fast SIMD bounding box filtering with configurable IoU and score thresholds.
  • Hardware Agnostic: Executes over ZeroTensor CPU SIMD or ZeroCompute Direct3D 11 GPU compute contexts.

๐Ÿ“ฆ Installation

Install via the .NET CLI:

dotnet add package ZeroInference.Core

๐Ÿš€ Quick Start

1. Parsing and Executing an ONNX Model

using ZeroInference.Core.Engine;
using ZeroInference.Core.Format;
using ZeroTensor.Core;

// 1. Load and parse .onnx model file
using var stream = File.OpenRead("models/classifier.onnx");
var graph = OnnxModelParser.Parse(stream);

// 2. Instantiate inference engine
var engine = new InferenceEngine(graph);

// 3. Prepare input tensor and infer
var input = Tensor.RandomUniform(1, 3, 224, 224);
var outputs = engine.Forward(input);

Console.WriteLine($"Inference Output Shape: [{outputs[0].Shape[0]}, {outputs[0].Shape[1]}]");

2. Fast Object Detection NMS Post-Processing

using ZeroInference.Core.Vision;

var candidateBoxes = new List<BoundingBox>
{
    new BoundingBox(10, 10, 50, 50, score: 0.92f, classId: 1),
    new BoundingBox(12, 11, 48, 52, score: 0.78f, classId: 1), // Overlapping duplicate
    new BoundingBox(100, 120, 60, 40, score: 0.85f, classId: 2)
};

// Filter duplicates with IoU threshold = 0.45
var filtered = NonMaximumSuppression.Filter(candidateBoxes, iouThreshold: 0.45f, scoreThreshold: 0.5f);

Console.WriteLine($"Remaining boxes after NMS: {filtered.Count}");

๐Ÿ“Š Benchmark & Performance

Tested on MobileNet-V2 / ResNet-18 (Release x64):

Architecture Model Size Load Time CPU SIMD Latency External DLLs
MobileNet-V2 $14.2 \text{ MB}$ $18.4 \text{ ms}$ $12.1 \text{ ms}$ 0 (Pure C#)
ResNet-18 (FP32) $45.1 \text{ MB}$ $42.0 \text{ ms}$ $28.5 \text{ ms}$ 0 (Pure C#)
ResNet-18 (Int8) $11.3 \text{ MB}$ $12.5 \text{ ms}$ $9.4 \text{ ms}$ 0 (Pure C#)

๐Ÿ“„ License

MIT License ยฉ 2026 Phong Vรต. Part of the ZeroPlatform project.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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 was computed.  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 was computed.  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 netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ZeroInference.Core:

Package Downloads
ZeroPipeline.Nodes

Industrial Concrete Pipeline Nodes: Machine Vision, Metrology, Barcode/QR Decoders, AI Inference, Modbus PLC, and Gorilla TimeSeries Logging for ZeroPlatform.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 93 9/9/2026