SimdFace 1.1.0

dotnet add package SimdFace --version 1.1.0
                    
NuGet\Install-Package SimdFace -Version 1.1.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="SimdFace" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SimdFace" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="SimdFace" />
                    
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 SimdFace --version 1.1.0
                    
#r "nuget: SimdFace, 1.1.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 SimdFace@1.1.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=SimdFace&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=SimdFace&version=1.1.0
                    
Install as a Cake Tool

SimdFace

SimdFace is a .NET 10 library for local face detection, 1:1 face verification, and camera liveness checks. YuNet returns face boxes and five landmarks, and SFace extracts normalized 128-dimensional embeddings. The library uses C# SIMD on the CPU and can run inference through Vulkan on 64-bit Windows or Linux with a compatible driver.

dotnet add package SimdFace --version 1.1.0

Download the pinned YuNet and SFace ONNX weights with pwsh -File ./scripts/Get-Models.ps1 from the repository root. The script verifies SHA-256. Pass the downloaded model paths to the constructors and supply tightly packed RGB24 pixels in row order. Model download instructions

using System;
using System.IO;
using SimdFace;

var detector = new FaceDetector(Path.Combine("models", FaceDetector.ModelFileName));
var recognizer = new FaceRecognizer(Path.Combine("models", FaceRecognizer.ModelFileName));

float[] Extract(ReadOnlySpan<byte> rgb, int width, int height)
{
    var faces = detector.Detect(rgb, width, height);
    if (faces.Count != 1)
        throw new InvalidOperationException("Expected exactly one face.");

    return recognizer.EmbedForVerification(rgb, width, height, faces[0].Landmarks);
}

// Compare two embeddings from the same extraction pipeline:
// float score = FaceRecognizer.CosineSimilarity(first, second);

Camera liveness verification

Get the camera model weights and place all four ONNX files under models/ in your working directory. Supply the decoded RGB24 reference photo and frames in capture order at the camera cadence. This standalone example uses the default implicit usings in a .NET 10 console project.

using SimdFace;

var detector = new FaceDetector(Path.Combine("models", FaceDetector.ModelFileName));
var recognizer = new FaceRecognizer(Path.Combine("models", FaceRecognizer.ModelFileName));
var antiSpoof = new FaceAntiSpoof(Path.Combine("models", FaceAntiSpoof.ModelFileName));
var mesh = new FaceMesh(Path.Combine("models", FaceMesh.ModelFileName));

async Task<bool> VerifyAsync(RgbFrame photo, IAsyncEnumerable<RgbFrame> frames,
    Action<FaceVerificationResult> showPrompt, CancellationToken cancellationToken = default)
{
    var faces = detector.Detect(photo.Pixels, photo.Width, photo.Height);
    if (faces.Count != 1)
        throw new ArgumentException("The reference photo must contain exactly one face.", nameof(photo));

    var reference = recognizer.EmbedForVerification(
        photo.Pixels, photo.Width, photo.Height, faces[0].Landmarks, cancellationToken);
    var session = new FaceVerificationSession(detector, recognizer, antiSpoof, mesh, reference);

    await foreach (var frame in frames.WithCancellation(cancellationToken))
    {
        var result = session.ProcessFrame(frame.Pixels, frame.Width, frame.Height, cancellationToken);
        showPrompt(result);
        if (result.IsFinished)
            return result.Liveness == FaceLivenessDecision.Passed &&
                   result.Identity == FaceIdentityDecision.Match;
    }

    return false;
}

public sealed record RgbFrame(byte[] Pixels, int Width, int Height);

Read Stage, TurnDirection, ExpressionPrompt, and Hint in showPrompt to guide the subject. Set the attempt time limit with a cancellation token. Vulkan can run YuNet and SFace. The anti-spoof and face mesh models run on the CPU.

The package includes the inference library, embedded Vulkan shaders, and Chinese IntelliSense documentation. Download the model weights separately. The repository also provides image decoding, a CLI, and a web app. English documentation · 中文文档

SimdFace is MIT-licensed. The package includes the MIT notices for SimdFace and the Vulkan bindings adapted from SimdSkia. Model weights have separate upstream licenses.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

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.1.0 0 11/12/2026
1.0.0 50 11/10/2026