ArcFace.Net 3.2.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package ArcFace.Net --version 3.2.2                
NuGet\Install-Package ArcFace.Net -Version 3.2.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="ArcFace.Net" Version="3.2.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ArcFace.Net --version 3.2.2                
#r "nuget: ArcFace.Net, 3.2.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.
// Install ArcFace.Net as a Cake Addin
#addin nuget:?package=ArcFace.Net&version=3.2.2

// Install ArcFace.Net as a Cake Tool
#tool nuget:?package=ArcFace.Net&version=3.2.2                

ArcFace.Net

虹软人脸识别.NET工具库(.Net Standard 2.1)。基于ArcFace 3.x C++ SDK, 支持Windows x86/x64和Linux x64. 支持人脸属性检测、人脸特征提取、人脸库维护、人脸搜索、活体检测等功能。

平台支持

  1. Windows x86/x64

  2. Linux x64

    • 该程序基于ArcFace 3.x C++ SDK开发,DllImport引入C++动态库时依赖于Linux系统库(libdl.so.2),因此低配Linux环境(如Alpine等)可能存在兼容性问题。 经测试以下可以正常运行。
      • Debian 10 +
      • Ubuntu20.04 +
      • CentOS 8 +
    • Linux环境中图像处理依赖libgdiplus包,需要手动安装到系统中。需要特别注意的是,libgdiplus是基于Mono框架开发的,系统中务必要安装Mono框架,否则可能会导致Graphics等对象申请的内存无法被回收最终导致内存溢出。
      # Debian 10
      sudo apt install apt-transport-https dirmngr gnupg ca-certificates
      sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
      echo "deb https://download.mono-project.com/repo/debian stable-buster main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
      sudo apt update
      sudo apt install mono-devel
      sudo apt install libgdiplus/stable
      
      # Ubuntu 20.04
      sudo apt install gnupg ca-certificates
      sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
      echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
      sudo apt update
      sudo apt install mono-devel
      sudo apt install libgdiplus/focal
      
      # CentOS 8
      rpmkeys --import "http://pool.sks-keyservers.net/pks/lookup?op=get&search=0x3fa7e0328081bff6a14da29aa6a19b38d3d831ef"
      su -c 'curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo'
      sudo yum install mono-devel
      sudo yum install libgdiplus-devel.x86_64
      

SDK

虹软开发者中心此处下载需要的SDK 3.x文件并放置同特定目录。

  • Windows 需要将SDK dll文件拷贝到执行程序所在目录,或环境变量配置的目录
  • Linux 需要将SDK so文件拷贝到/lib等系统程序目录,或环境变量配置的目录

虹软开发者中心 获取授权信息(AppId/SdkKey),通过ArcFaceOptions传入配置。具体用法参见 示例程序

资源回收

  • 工具中自动维护引擎池进行资源回收利用,无需手动管理。
  • 工具支持多并发操作。
  • 推荐使用单例方式使用。
  • ArcFace实现IDisposable,使用完毕后需要Dispose()以销毁引擎回收其它相关内存。

图像质量要求

  • 图片尺寸大于2K且小于10MB
  • 图片格式支持 ".jpg",".png",".bmp"
  • 图片中人脸尺寸不小于50 x 50像素
  • 建议待检测的图像人脸角度上、下、左、右转向小于30度

人脸3D角度

俯仰角(pitch), 横滚角(roll), 偏航角(yaw)

alternate text is missing from this package README image

问题

  • 人脸检测和特性提取目前进识别到的人脸角度不准确,目前识别到的角度均为0度。
  • 视频模式人脸追踪未开发
  • 活体检测未开发

参考文档

https://github.com/colin-chang/ArcFace.Net/blob/main/sdk_3.0.pdf

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on ArcFace.Net:

Package Downloads
CameraFaceRecognition

A package for camera and face recognition services using ArcFace.

VIT.Infrastructure

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
5.1.4 784 5/26/2023
5.1.3 880 5/22/2023
5.1.2 200 5/18/2023
5.0.0 177 5/14/2023
4.2.4 206 5/26/2023
4.2.2 178 5/18/2023
4.1.2 188 5/13/2023
4.1.1 722 1/30/2023
4.1.0 1,295 6/11/2022
4.0.2 500 6/7/2022
4.0.1 651 2/28/2022
4.0.0 470 2/27/2022
3.2.9 478 2/25/2022
3.2.8 500 1/29/2022
3.2.7 464 1/21/2022
3.2.6 512 8/12/2021
3.2.5 386 8/3/2021
3.2.4 439 5/6/2021
3.2.3 368 5/3/2021
3.2.2 402 4/19/2021
3.2.1 369 4/6/2021
3.2.0 602 12/25/2020
3.1.0 449 12/16/2020
3.0.3 454 12/9/2020
3.0.2 454 12/8/2020
3.0.1 432 12/7/2020
3.0.0 471 12/2/2020

add 'DetectFaceFromBase64StringAsync' method