kby-ai/FaceAttribute-iOS

GitHub: kby-ai/FaceAttribute-iOS

一款集成3D静默活体检测、人脸比对及多维度属性分析的iOS人脸识别SDK演示项目。

Stars: 22 | Forks: 10

### 我们的人脸识别算法在 NIST FRVT 1:1 排行榜中荣获全球顶尖排名。 badge [最新 NIST FRVT 评估报告 2024-12-20](https://pages.nist.gov/frvt/html/frvt11.html) ![FRVT Sheet](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/4159e4e24d213657.jpg) #### 🆔 ID Document Liveness Detection - Linux - [这里](https://web.kby-ai.com) badge #### 📚 产品与资源 - [这里](https://github.com/kby-ai/Product) #### 🛟 帮助中心 - [这里](https://docs.kby-ai.com) #### 💼 KYC 验证演示 - [这里](https://github.com/kby-ai/KYC-Verification-Demo-Android) #### 🙋‍♀️ Docker Hub - [这里](https://hub.docker.com/u/kbyai) # FaceAttribute-iOS ## 概述 本仓库集成了多种 `人脸识别` 技术,包括 `3D 被动人脸活体检测`、`人脸识别`、`自动人脸抓拍`,以及对各种 `人脸属性` 的分析,例如 `年龄`、`性别`、`人脸质量`、`人脸遮挡`、`闭眼` 和 `张嘴`。 系统利用 `人脸活体检测` 技术,基于摄像头拍摄的单张图像生成实时活体分数。 此外,本演示还提供 `人脸识别` 功能,支持从图库中注册并对摄像头捕捉到的人脸进行实时识别。 本仓库具有 `自动人脸抓拍` 功能,可验证各种 `人脸属性`,例如 `人脸质量`、`人脸姿态` (yaw, roll, pitch)、`人脸遮挡`(如口罩、墨镜、手遮挡面部)、`闭眼`、`张嘴` 以及人脸在 `感兴趣区域` (`ROI`) 内的位置。 此外,该仓库还能计算图库图像中不同人脸属性的分数,包括 `活体`、`人脸朝向` (yaw, roll, pitch)、`人脸质量`、`人脸亮度`、`人脸遮挡`、`闭眼`、`张嘴`、`年龄` 和 `性别`。 ### ◾FaceSDK(Mobile) 详情 | Basic | Standard | 🔽 Premium | |------------------|------------------|------------------| | Face Detection | Face Detection | Face Detection | | Face Liveness Detection | Face Liveness Detection | Face Liveness Detection | | Pose Estimation | Pose Estimation | Pose Estimation | | | Face Recognition | Face Recognition | | | | 68 points Face Landmark Detection | | | | Face Quality Calculation | | | | Face Occlusion Detection | | | | Eye Closure Detection | | | | Age, Gender Estimation | ### ◾FaceSDK(Mobile) 产品列表 | No. | Repository | SDK Details | |------------------|------------------|------------------| | 1 | [Face Liveness Detection - Android](https://github.com/kby-ai/FaceLivenessDetection-Android) | Basic SDK | | 2 | [Face Liveness Detection - iOS](https://github.com/kby-ai/FaceLivenessDetection-iOS) | Basic SDK | | 3 | [Face Recognition + Face Liveness Detection - Android](https://github.com/kby-ai/FaceRecognition-Android) | Standard SDK | | 4 | [Face Recognition + Face Liveness Detection - iOS](https://github.com/kby-ai/FaceRecognition-iOS) | Standard SDK | | 5 | [Face Recognition + Face Liveness Detection - Flutter](https://github.com/kby-ai/FaceRecognition-Flutter) | Standard SDK | | 6 | [Face Recognition + Face Liveness Detection - Ionic-Cordova](https://github.com/kby-ai/FaceRececogniion-Ionic-Cordova) | Standard SDK | | 7 | [Face Recognition + Face Liveness Detection - React-Native](https://github.com/kby-ai/FaceRecognition-React-Native) | Standard SDK | | 8 | [Face Attribute - Android](https://github.com/kby-ai/FaceAttribute-Android) | Premium SDK | | ➡️ | [Face Attribute - iOS](https://github.com/kby-ai/FaceAttribute-iOS) | Premium SDK | | 10 | [Face Attribute - Flutter](https://github.com/kby-ai/FaceAttribute-Flutter) | Premium SDK | ## 在 App Store 下载 ## 性能视频 您可以访问我们的 YouTube 视频 [这里](https://www.youtube.com/watch?v=-WiAethTacc),查看我们演示应用的运行效果。

[![Face Recognition Android](https://img.youtube.com/vi/-WiAethTacc/0.jpg)](https://www.youtube.com/watch?v=-WiAethTacc) ## 截图

## SDK 许可证 `face attribute` 项目依赖于 `KBY-AI` 的 SDK,该 SDK 需要为 `iOS` 项目的每个 `bundle ID` 获取许可证。 - 以下代码展示了如何使用许可证:https://github.com/kby-ai/FaceAttribute-iOS/blob/3e377692dcd101067ba57033db8a43a84ceced28/FaceAttribute/ViewController.swift#L42-L51 - 如需申请许可证,请联系我们:
🧙`Email:` contact@kby-ai.com
🧙`Telegram:` [@kbyaisupport](https://t.me/kbyaisupport)
🧙`WhatsApp:` [+19092802609](https://wa.me/+19092802609)
🧙`Discord:` [KBY-AI](https://discord.gg/6wm383re2s)
🧙`Teams:` [KBY-AI](https://teams.live.com/l/invite/FBAYGB1-IlXkuQM3AY)
## 关于 SDK ### 1. 设置 - 将 `SDK`(`facesdk.framework` 文件夹)复制到项目的 `root`(根)文件夹中。 - 在 `Xcode` 中将 `SDK framework` 添加到项目中。 ![image](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/27de52ad60213702.png) - 将 bridging header 添加到您的项目设置中 ![image](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/222d58ffb8213705.png) ### 2. 初始化 SDK - 第一步 首先,您需要使用收到的许可证激活 `SDK`。 FaceSDK.setActivation("...") 如果激活成功,返回值将为 `SDK_SUCCESS`。否则,将返回错误值。 - 第二步 激活后,调用 `SDK` 的初始化函数。 FaceSDK.initSDK() 如果初始化成功,返回值将为 `SDK_SUCCESS`。否则,将返回错误值。 ### 3. SDK 类 - FaceBox 该类代表人脸检测函数的输出,并可用于 `template`(特征模版)创建函数。 | Feature| Type | Name | |------------------|------------------|------------------| | Face rectangle | int | x1, y1, x2, y2 | | Face angles (-45 ~ 45) | float | yaw, roll, pitch | | Liveness score (0 ~ 1) | float | liveness | | Face quality (0 ~ 1) | float | face_quality | | Face luminance (0 ~ 255) | float | face_luminance | | Face occlusion (0 ~ 1) | float | face_occlusion | | Eye closure (0 ~ 1) | float | left_eye, right_eye | | Mouth opening (0 ~ 1) | float | face_mouth_opened | | Age, gender | int | age, gender | | 68 points facial landmark | Data | landmark | - FaceDetectionParam 该类作为 `face detection` 的输入参数,支持启用各种处理功能,如 `face liveness detection`、`eye closure checking`、`facial occlusion checking`、`mouth opening checking` 和 `age and gender estimation`。 | Feature| Type | Name | |------------------|------------------|------------------| | Check liveness | bool | check_liveness | | Check eye closure | bool | check_eye_closeness | | Check face occlusion | bool | check_face_occlusion | | Check mouth opening | bool | check_mouth_opened | | Estimate age, gender | bool | estimate_age_gender | ### 4. SDK APIs #### - Face Detection `Face SDK` 提供了统一的人脸检测函数,支持启用多种功能,例如 `liveness detection`、`face orientation` (yaw, roll, pitch)、`face quality`、`facial occlusion`、`eye closure`、`mouth opening`、`age`、`gender` 和 `facial landmarks`。 该函数的使用方式如下: ``` let faceBoxes = FaceSDK.faceDetection(image, param: param) ``` 此函数需要两个参数:一个 `UIImage` 对象和一个 `FaceDetectionParam` 对象,后者用于启用各种处理功能。 该函数返回一个 `FaceBox` 对象列表。 #### - Create Templates `FaceSDK` 提供了一个函数,可以从 `UIImage` 图像生成 `template`(特征模版)。然后可以使用该模板来验证捕捉到的个人图像的身份。 ``` let templates = FaceSDK.templateExtraction(image, faceBox: faceBox) ``` `SDK` 的 `template` 提取函数接受两个参数:一个 `UIImage` 对象和一个 `FaceBox` 对象。 该函数返回一个 `Data`,其中包含可用于人员验证的 `template`。 #### - Calculation similiarity `similarityCalculation` 函数接受两个 `template` 的字节数组作为参数。 ``` let similarity = FaceSDK.similarityCalculation(templates, templates2: personTemplates) ``` 它返回两个模板之间的相似度值,该值可用于确定两个个体之间的相似程度。
标签:3D静默活体, CVE监控, iOS开发, KYC验证, NISTFRVT, 人脸SDK, 人脸属性分析, 人脸抓拍, 人脸比对, 人脸活体检测, 人脸识别, 人脸质量评估, 人脸遮挡检测, 反欺诈, 年龄估计, 张嘴检测, 性别识别, 生物特征识别, 睁眼闭眼检测, 计算机视觉