Shiny.DocumentIntelligence
1.0.0-beta-0002
Prefix Reserved
dotnet add package Shiny.DocumentIntelligence --version 1.0.0-beta-0002
NuGet\Install-Package Shiny.DocumentIntelligence -Version 1.0.0-beta-0002
<PackageReference Include="Shiny.DocumentIntelligence" Version="1.0.0-beta-0002" />
<PackageVersion Include="Shiny.DocumentIntelligence" Version="1.0.0-beta-0002" />
<PackageReference Include="Shiny.DocumentIntelligence" />
paket add Shiny.DocumentIntelligence --version 1.0.0-beta-0002
#r "nuget: Shiny.DocumentIntelligence, 1.0.0-beta-0002"
#:package Shiny.DocumentIntelligence@1.0.0-beta-0002
#addin nuget:?package=Shiny.DocumentIntelligence&version=1.0.0-beta-0002&prerelease
#tool nuget:?package=Shiny.DocumentIntelligence&version=1.0.0-beta-0002&prerelease
Shiny Face & Document Intelligence
On-device intelligence for .NET (MAUI + native), built on the Shiny stack. Two independent stacks:
Face intelligence — enrollment + recognition
- Capture + detect —
Shiny.Maui.Controls.Camera+Shiny.Maui.Controls.Camera.Face(live preview, on-device detection via Apple Vision / Android ML Kit). Detection gives face bounds, not embeddings. - Embed —
Shiny.FaceIntelligence.Onnx: crop the detected face → ArcFace ONNX (Microsoft.ML.OnnxRuntime) → a 512-d, L2-normalized vector. - Store + match —
Shiny.FaceIntelligence.DocumentDb.SqliteoverShiny.DocumentDb.Sqlitevector search (NearestVectors, backed by sqlite-vec /vec0).
"Training" here is enrollment: store several embeddings per person; recognition is a nearest-neighbor lookup with a cosine-distance threshold. No model is trained on-device. The pipeline is split into a core package plus swappable embedder/store packages, composed via a registration builder — pull only what you use (native embedder without ONNX, Postgres without sqlite, etc.).
Document intelligence — native modal scanner
Shiny.DocumentIntelligence puts one IDocumentScanner.ScanAsync(...) over each platform's first-party scanner: VisionKit (iOS/Mac Catalyst), ML Kit (Android, optional PDF), and Vision document segmentation on macOS AppKit (which has no document camera — it deskews picked images). No MAUI dependency.
| Package | TFM | Role |
|---|---|---|
Shiny.FaceIntelligence |
net10.0 |
Core: contracts (IFaceEmbedder, IFaceStore, IFaceIntelligence), FaceIntelligenceManager, imaging, builder. SkiaSharp only. |
Shiny.FaceIntelligence.Onnx |
net10.0 |
ONNX ArcFace embedder (UseOnnxEmbedder) + iOS linker fix. |
Shiny.FaceIntelligence.DocumentDb |
net10.0 |
Provider-agnostic Shiny.DocumentDb store (UseDocumentDbStore). |
Shiny.FaceIntelligence.DocumentDb.Sqlite |
net10.0 |
Turnkey sqlite-vec store (UseSqliteStore). |
Shiny.DocumentIntelligence |
net10.0;-android;-ios;-maccatalyst;-macos |
Native document scanner (IDocumentScanner, AddDocumentIntelligence). |
Sample (root) |
net10.0-android;net10.0-ios |
MAUI app (Shiny.Maui.Shell MVVM): Recognize / Enroll / People / Scan tabs. |
Quick start
dotnet build Sample/Sample.csproj -f net10.0-android
dotnet build Sample/Sample.csproj -f net10.0-ios
Compose the pipeline at startup:
services.AddFaceIntelligence(face =>
{
face.Options.MaxDistance = 0.6f;
face.UseOnnxEmbedder(o => o.ModelBytesProvider = () => LoadBundledModel("arcface.onnx"));
face.UseSqliteStore(o => { o.ConnectionString = "Data Source=faces.db"; o.VectorExtensionPath = "vec0"; });
});
Add the document scanner alongside it and call it from anywhere:
services.AddDocumentIntelligence(); // registers IDocumentScanner
// later, in a ViewModel/service
var result = await scanner.ScanAsync(new DocumentScanRequest { PageLimit = 10 });
if (!result.IsCancelled)
foreach (var page in result.Pages) { /* page.ImageData (PNG/JPEG) */ }
Two assets are not in the repo and required at runtime: an ArcFace ONNX model and the sqlite-vec native binary (vec0.dylib/vec0.so). Drop the model at Sample/Resources/Raw/arcface.onnx (a compact 112×112 ArcFace like MobileFaceNet keeps app size down) — it's loaded from the app package as bytes. The app launches without these; enroll/recognize report "model missing". See CLAUDE.md for details.
Benchmarks
Recognition latency (embed + sqlite-vec NearestVectors + threshold) as the enrolled gallery grows, at the real 512-d ArcFace width. A deterministic fake embedder isolates the vector-store cost; no ONNX model involved. Reproduce with dotnet run --project tests/Shiny.FaceIntelligence.Benchmarks -c Release -- --filter '*'.
BenchmarkDotNet v0.15.8 · Apple M5 Pro · .NET 10.0.8 (Arm64) · macOS 26.5
| Gallery size | Mean | Allocated |
|---|---|---|
| 100 | 259.0 µs | 91 KB |
| 1,000 | 487.8 µs | 91 KB |
| 10,000 | 4,758.3 µs | 91 KB |
Brute-force exact search scales roughly linearly with gallery size (VectorIndexKind.None); ~4.8 ms at 10k enrolled shots is comfortable for on-device use. Managed allocations are constant (the result set), independent of gallery size. For much larger galleries, switch to an ANN index.
Development
Architecture, build/pack details, the ONNX Runtime iOS linker fix, tuning, and the open TODOs (identity hardening, coordinate space, landmark alignment) are documented in CLAUDE.md — the canonical reference for working in this repo.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-android36.0 is compatible. net10.0-browser was computed. net10.0-ios was computed. net10.0-ios26.0 is compatible. net10.0-maccatalyst was computed. net10.0-maccatalyst26.0 is compatible. net10.0-macos was computed. net10.0-macos26.0 is compatible. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
-
net10.0-android36.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Xamarin.GooglePlayServices.MLKit.BarcodeScanning (>= 118.3.1.7)
- Xamarin.GooglePlayServices.MLKit.DocumentScanner (>= 116.0.0.2)
- Xamarin.GooglePlayServices.MLKit.Text.Recognition (>= 119.0.1.7)
-
net10.0-ios26.0
-
net10.0-maccatalyst26.0
-
net10.0-macos26.0
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 |
|---|---|---|
| 1.0.0-beta-0002 | 0 | 7/27/2026 |