高精度人脸表情识别 开源代码

人脸表情识别+半监督

Margin-Mix: Semi–Supervised Learning for Face Expression Recognition

作者 | Corneliu Florea, Mihai Badea, Laura Florea, Andrei Racoviteanu, Constantin Vertan

单位 | 布加勒斯特理工大学

论文 | https://www.ecva.net/papers/eccv_2020/

papers_ECCV/papers/123680001.pdf

代码 | https://github.com/YU1ut/MixMatch-pytorch

备注 | ECCV 2020

有关键点,表情,表情模型好像120m

https://github.com/WIKI2020/FacePose_pytorch

模型120M

https://github.com/intelligent-human-perception-laboratory/Face-Warping-Emotion-Recognition

这个项目没测试,年龄,性别,表情模型 53m</

  • 13
    点赞
  • 155
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
以下是使用 C# 实现人脸识别的代码,其中使用了精度算法: ```csharp using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Drawing; using System.Drawing.Imaging; using System.IO; using Microsoft.Azure.CognitiveServices.Vision.Face; using Microsoft.Azure.CognitiveServices.Vision.Face.Models; using MathNet.Numerics.LinearAlgebra; namespace HighAccuracyFaceRecognition { class Program { static void Main(string[] args) { // 读取图片文件 string imagePath = "path/to/image.jpg"; Bitmap image = new Bitmap(imagePath); // 将图片转换为字节数组 byte[] imageData; using (MemoryStream ms = new MemoryStream()) { image.Save(ms, ImageFormat.Jpeg); imageData = ms.ToArray(); } // 初始化 Face API 客户端 string subscriptionKey = "your-subscription-key"; string endpoint = "https://your-endpoint.cognitiveservices.azure.com/"; FaceClient faceClient = new FaceClient(new ApiKeyServiceClientCredentials(subscriptionKey)) { Endpoint = endpoint }; // 配置人脸检测参数 IList<FaceAttributeType> faceAttributes = new List<FaceAttributeType>() { FaceAttributeType.Emotion, FaceAttributeType.Gender, FaceAttributeType.Age, FaceAttributeType.Smile, FaceAttributeType.Glasses, FaceAttributeType.HeadPose }; // 检测人脸 DetectResult[] detectResults = faceClient.Face.DetectWithStreamAsync(new MemoryStream(imageData), true, false, faceAttributes).Result; // 遍历检测结果 foreach (DetectResult detectResult in detectResults) { // 获取人脸特征向量 Guid faceId = detectResult.FaceId.Value; FaceAttribute features = detectResult.FaceAttributes; double[] featureVector = GetFeatureVector(faceClient, faceId); // 进行人脸识别 string personName = RecognizeFace(featureVector); // 输出结果 Console.WriteLine($"Person name: {personName}"); Console.WriteLine($"Emotion: {features.Emotion.ToRankedList().First().Key}"); Console.WriteLine($"Gender: {features.Gender}"); Console.WriteLine($"Age: {features.Age}"); Console.WriteLine($"Smile: {features.Smile}"); Console.WriteLine($"Glasses: {features.Glasses}"); Console.WriteLine($"Head pose: roll={features.HeadPose.Roll}, yaw={features.HeadPose.Yaw}, pitch={features.HeadPose.Pitch}"); } } static double[] GetFeatureVector(FaceClient faceClient, Guid faceId) { // 获取人脸特征向量 const int FEATURE_VECTOR_SIZE = 512; FaceAttributeType[] faceAttributes = { FaceAttributeType.FaceLandmarks }; FaceAttribute[] attributes = faceClient.Face.GetFaceAttributesAsync(faceId, faceAttributes).Result; Landmarks landmarks = attributes[0].FaceLandmarks; DenseMatrix imagePoints = DenseMatrix.OfArray(new double[,] { { landmarks.PupilLeft.X, landmarks.PupilLeft.Y }, { landmarks.PupilRight.X, landmarks.PupilRight.Y }, { landmarks.NoseTip.X, landmarks.NoseTip.Y }, { landmarks.MouthLeft.X, landmarks.MouthLeft.Y }, { landmarks.MouthRight.X, landmarks.MouthRight.Y } }); Vector<double> featureVector = FaceRecognition.ComputeFaceDescriptor(imagePoints, FEATURE_VECTOR_SIZE); return featureVector.ToArray(); } static string RecognizeFace(double[] featureVector) { // TODO: 实现人脸识别算法,返回识别结果 return "Unknown"; } } } ``` 在上述代码中,`GetFeatureVector` 函数使用 `Face API` 获取人脸关键点坐标,然后调用 `FaceRecognition.ComputeFaceDescriptor` 函数计算人脸特征向量。`RecognizeFace` 函数需要根据已有的人脸库进行人脸识别,这里需要自己实现。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

AI算法网奇

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值