OpenVinoSharp.SFace 1.0.0

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

OpenVinoSharp.SFace

YuNet face detection + SFace face recognition on Intel OpenVINO, implemented in pure C# on top of OpenVinoSharp (Guojin Yan) — no OpenCV dependency.

The pre/post-processing is a faithful port of the OpenCV Zoo reference implementations (face_detection_yunet, face_recognition_sface), so results match cv.FaceDetectorYN / cv.FaceRecognizerSF.

Usage

using OpenVinoSharp.FaceRecognition;

using var detector = new YuNetFaceDetector("face_detection_yunet_2023mar.onnx", "CPU", confThreshold: 0.9f);
using var recognizer = new SFaceRecognizer("face_recognition_sface_2021dec.onnx", "CPU");

var faces1 = detector.Detect(image1);          // List<FaceDet>, ordered by descending score
var faces2 = detector.Detect(image2);

float[] f1 = recognizer.ExtractFeature(image1, faces1[0]);   // 128-D
float[] f2 = recognizer.ExtractFeature(image2, faces2[0]);

FaceMatch m = SFaceRecognizer.Match(f1, f2);   // cosine >= 0.363 -> same identity
Console.WriteLine($"{m.Score:F4} {m.Verdict}");

Provide your own BGR byte buffers via BgrImage(width, height, byte[]) (H * W * 3, interleaved BGR), or convert System.Drawing.Bitmap in your app.

Supported models

Model File Notes
YuNet face detection face_detection_yunet_2023mar.onnx 5-landmark, any input size (padded to /32)
SFace recognition face_recognition_sface_2021dec.onnx 128-D embedding

Download them from the OpenCV Zoo repository.

Targets

.NET Framework 4.6 / 4.8, .NET 8.0, 9.0, 10.0 (Windows x64; GPU device requires an Intel GPU with OpenVINO GPU plugin).

License

Apache-2.0. Model weights follow the OpenCV Zoo licenses.

Product Compatible and additional computed target framework versions.
.NET 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 is compatible.  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 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. 
.NET Framework net46 is compatible.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on OpenVinoSharp.SFace:

Package Downloads
OpenVinoSharp.SFace.OpenCvSharp

OpenCvSharp interop for OpenVinoSharp.SFace. Accepts OpenCvSharp Mat input directly for YuNet face detection and SFace face recognition - no Bitmap detour for camera/realtime pipelines. Requires the main OpenVinoSharp.SFace package.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 89 11/10/2026
1.0.1 85 11/10/2026
1.0.0 74 11/10/2026