RustODotnet 0.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package RustODotnet --version 0.2.0
                    
NuGet\Install-Package RustODotnet -Version 0.2.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="RustODotnet" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RustODotnet" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="RustODotnet" />
                    
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 RustODotnet --version 0.2.0
                    
#r "nuget: RustODotnet, 0.2.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 RustODotnet@0.2.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=RustODotnet&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=RustODotnet&version=0.2.0
                    
Install as a Cake Tool

RustODotnet

High-performance cross-platform OCR library for .NET based on RustO! and PaddleOCR, powered by the lightweight MNN inference engine.

NuGet License: MIT

📦 Installation

Install the core runtime package via NuGet:

dotnet add package RustODotnet

Choose an OCR Model Package

Models are distributed as modular NuGet packages so you can pick the tier that suits your app:

# Recommended default (~6 MB)
dotnet add package RustODotnet.Models.PPOCRv6.Tiny

# Higher accuracy PP-OCRv6 tiers
dotnet add package RustODotnet.Models.PPOCRv6.Small    # ~30 MB
dotnet add package RustODotnet.Models.PPOCRv6.Medium   # ~134 MB

# PP-OCRv5 tiers
dotnet add package RustODotnet.Models.PPOCRv5.Mobile   # ~28 MB
dotnet add package RustODotnet.Models.PPOCRv5.Server   # ~270 MB

# PP-OCRv4 tiers (with text orientation classifier)
dotnet add package RustODotnet.Models.PPOCRv4.Mobile   # ~23 MB
dotnet add package RustODotnet.Models.PPOCRv4.Server   # ~300 MB

Note: When referencing any model package, model files are automatically copied to your output models/ directory at build time.


🚀 Quick Start

1. Basic OCR (Automatic Model Discovery)

using System;
using RustODotnet;

// Initialize engine (automatically discovers models in models/ folder)
using var ocr = new RustO();

// Run OCR on an image file
var results = ocr.RecognizeFile("document.jpg");

foreach (var res in results)
{
    Console.WriteLine($"Text: '{res.Text}' (Confidence: {res.Score:P1})");
    Console.WriteLine($"  Frame: X={res.Frame.Left}, Y={res.Frame.Top}, W={res.Frame.Width}, H={res.Frame.Height}");
}

2. Formatted Spatial Layout Output

Preserve the spatial structure (columns, paragraphs, tables) of documents:

using var ocr = new RustO();

// Get text formatted as it appears visually
string spatialText = ocr.RecognizeFileToSpatialText("invoice.png");
Console.WriteLine(spatialText);

3. Advanced Configuration

using RustODotnet;

var config = new RustOConfig
{
    Template = "ppv6",
    DetModelPath = "models/det.mnn",
    RecModelPath = "models/rec.mnn",
    DictPath = "models/dict.txt",
    TextScore = 0.5f,
    DetThresh = 0.3f,
    DetBoxThresh = 0.6f,
    LimitSideLen = 960,
    UseDilation = true
};

using var ocr = new RustO(config);
var results = ocr.RecognizeFile("photo.jpg");

4. Recognize from In-Memory Bytes

byte[] imageBytes = File.ReadAllBytes("receipt.jpg");

using var ocr = new RustO();
var results = ocr.RecognizeBytes(imageBytes);

🌐 Supported Platforms

Native shared binaries are included out of the box for:

  • Windows: x64 (rusto.dll)
  • Linux: x64 (librusto.so)
  • macOS: x64 & ARM64 Apple Silicon (librusto.dylib)

Target frameworks: net8.0, net6.0, netstandard2.1.

📄 License

MIT License.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  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 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 netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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

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
0.2.5 79 8/20/2026
0.2.3 90 8/19/2026
0.2.2 88 8/19/2026
0.2.1 102 8/13/2026
0.2.0 86 8/13/2026
0.1.7 85 8/13/2026
0.1.6 84 8/12/2026
0.1.5 88 8/12/2026
0.1.4 91 8/12/2026
0.1.3 93 8/11/2026
0.1.2 241 12/24/2025
0.1.1 204 12/23/2025