RustODotnet 0.2.0
See the version list below for details.
dotnet add package RustODotnet --version 0.2.0
NuGet\Install-Package RustODotnet -Version 0.2.0
<PackageReference Include="RustODotnet" Version="0.2.0" />
<PackageVersion Include="RustODotnet" Version="0.2.0" />
<PackageReference Include="RustODotnet" />
paket add RustODotnet --version 0.2.0
#r "nuget: RustODotnet, 0.2.0"
#:package RustODotnet@0.2.0
#addin nuget:?package=RustODotnet&version=0.2.0
#tool nuget:?package=RustODotnet&version=0.2.0
RustODotnet
High-performance cross-platform OCR library for .NET based on RustO! and PaddleOCR, powered by the lightweight MNN inference engine.
📦 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 | Versions 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. |
-
.NETStandard 2.1
- System.Text.Json (>= 8.0.5)
-
net6.0
- System.Text.Json (>= 8.0.5)
-
net8.0
- System.Text.Json (>= 8.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.