Shiny.FaceIntelligence
1.0.0-beta-0002
Prefix Reserved
dotnet add package Shiny.FaceIntelligence --version 1.0.0-beta-0002
NuGet\Install-Package Shiny.FaceIntelligence -Version 1.0.0-beta-0002
<PackageReference Include="Shiny.FaceIntelligence" Version="1.0.0-beta-0002" />
<PackageVersion Include="Shiny.FaceIntelligence" Version="1.0.0-beta-0002" />
<PackageReference Include="Shiny.FaceIntelligence" />
paket add Shiny.FaceIntelligence --version 1.0.0-beta-0002
#r "nuget: Shiny.FaceIntelligence, 1.0.0-beta-0002"
#:package Shiny.FaceIntelligence@1.0.0-beta-0002
#addin nuget:?package=Shiny.FaceIntelligence&version=1.0.0-beta-0002&prerelease
#tool nuget:?package=Shiny.FaceIntelligence&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-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. |
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- SkiaSharp (>= 4.150.1)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Shiny.FaceIntelligence:
| Package | Downloads |
|---|---|
|
Shiny.FaceIntelligence.Maui
Live face recognition as a Shiny CameraView frame analyzer: detects faces on every frame and runs Shiny.FaceIntelligence recognition when a face holds steady — no still capture required. |
|
|
Shiny.FaceIntelligence.Onnx
ONNX ArcFace embedder for Shiny.FaceIntelligence (Microsoft.ML.OnnxRuntime). Ships the iOS/MacCatalyst RegisterCustomOps linker workaround. |
|
|
Shiny.FaceIntelligence.DocumentDb
Shiny.DocumentDb-backed face store for Shiny.FaceIntelligence (vector search). Provider-agnostic — supply any IDatabaseProvider (Sqlite, Postgres, ...). |
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 |