ArcFace.Net
4.0.0
See the version list below for details.
dotnet add package ArcFace.Net --version 4.0.0
NuGet\Install-Package ArcFace.Net -Version 4.0.0
<PackageReference Include="ArcFace.Net" Version="4.0.0" />
paket add ArcFace.Net --version 4.0.0
#r "nuget: ArcFace.Net, 4.0.0"
// Install ArcFace.Net as a Cake Addin #addin nuget:?package=ArcFace.Net&version=4.0.0 // Install ArcFace.Net as a Cake Tool #tool nuget:?package=ArcFace.Net&version=4.0.0
ArcFace.Net
虹软人脸识别.NET工具库(.Net Standard 2.1)。基于ArcFace 3.x C++ SDK, 支持Windows x86/x64和Linux x64. 支持人脸库属性检测、人脸特征提取、人脸库维护、人脸搜索、活体检测等功能。
平台支持
.NET 6 兼容问题
从 .NET 6 开始,当为非 Windows 操作系统编译引用代码时,平台分析器会发出编译时警告。 此外,除非设置了配置选项,否则将引发
System.PlatformNotSupportedException
异常,可通过将runtimeconfig.json
文件中的System.Drawing.EnableUnixSupportSystem.Drawing.EnableUnixSupport
设置为true
来启用对 .NET 6 中非 Windows 平台的支持
{
"configProperties": {
"System.Drawing.EnableUnixSupport": true
}
}
Windows x86/x64
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
- 该程序基于ArcFace 3.x C++ SDK开发,
Docker
我们为本程序库的运行环境打包了Docker镜像,有需要的读者可以点此获取,也可以使用 Dockerfiles 中的不同版本的Dockerfile文件自行编译。
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)
问题
- 人脸检测和特性提取目前进识别到的人脸角度不准确,目前识别到的角度均为0度。
- 视频模式人脸追踪未开发
- 活体检测未开发
参考文档
https://github.com/colin-chang/ArcFace.Net/blob/main/sdk_3.0.pdf
Product | Versions 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. |
-
.NETStandard 2.1
- Microsoft.Extensions.Configuration.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Options (>= 6.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 6.0.0)
- Microsoft.Extensions.Options.DataAnnotations (>= 6.0.0)
- Polly (>= 7.2.3)
- System.Drawing.Common (>= 6.0.0)
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 |
1.重构人脸库数据结构
2.重载和新增人脸库新增人脸方法
3.人脸搜索提供人脸库过滤功能