OpenVinoSharp.SFace.OpenCvSharp 1.0.2

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

OpenVinoSharp.SFace.OpenCvSharp

OpenCvSharp 互操作扩展,OpenVinoSharp.SFace(YuNet 人脸检测 + SFace 人脸识别,基于 OpenVINO)的 Mat 输入支持。

摄像头 / 视频流场景下无需再绕道 System.Drawing.Bitmap——把 VideoCapture 读到的 Mat 帧直接喂给检测与识别 API,每帧只做一次托管内存拷贝。

安装

Install-Package OpenVinoSharp.SFace.OpenCvSharp

(自动带上主包 OpenVinoSharp.SFace、OpenVINO 运行时与 OpenCvSharp4。)

用法

using OpenCvSharp;
using OpenVinoSharp.FaceRecognition;

using var capture = new VideoCapture(0);          // 摄像头
using var det = new YuNetFaceDetector("yunet.onnx", "CPU", 0.6f, 0.3f, 5000);
using var rec = new SFaceRecognizer("sface.onnx", "CPU");

using var frame = new Mat();
while (capture.Read(frame) && !frame.Empty())
{
    List<FaceDet> faces = det.Detect(frame);       // 直接吃 Mat
    if (faces.Count > 0)
    {
        float[] feat = rec.ExtractFeature(frame, faces[0]);
        using Mat aligned = rec.AlignCrop(frame, faces[0]);   // 112x112 8UC3
        // ...绘制/匹配
    }
}

任意 Mat(8UC3 / 8UC4 / 8UC1 / 其它深度的 3 通道)都会被正确转换;8UC3 连续内存走零转换快路径。

注意

  • 目标框架:net48、net8.0、net9.0、net10.0(OpenCvSharp4 4.13 不提供 net46 兼容资源,net46 请使用主包 + DrawingConvert)。
  • Mat 与 BgrImage 同为 BGR 通道序,转换不涉及通道交换。

License

Apache-2.0。第三方组件见 THIRD-PARTY-NOTICES.txt。

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 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

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.3 77 11/10/2026
1.0.2 76 11/10/2026