add 增加人脸对比

This commit is contained in:
2025-03-20 16:18:00 +08:00
parent 22b5041bb2
commit 5b3e6418f6
4 changed files with 43 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
using Dlhis.InfoCheck.Api.Requests;
using Dlhis.InfoCheck.Api.Response;
using Kurisu.RemoteCall.Attributes;
namespace Dlhis.InfoCheck.Api;
@@ -17,4 +18,12 @@ public interface IInfoCheckApi
/// <returns></returns>
[Post("/api/face/detection")]
Task<List<string>> FaceDetectAsync(FaceDetectRequest request);
/// <summary>
/// 人脸对比
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[Post("/api/face/recognize")]
Task<FaceRecognizeResponse> FaceRecognizeAsync(FaceRecognizeRequest request);
}

View File

@@ -0,0 +1,14 @@
namespace Dlhis.InfoCheck.Api.Requests;
public class FaceRecognizeRequest
{
/// <summary>
/// 第一张图片
/// </summary>
public string FirstBase64 { get; set; }
/// <summary>
/// 第二张图片
/// </summary>
public string SecondBase64 { get; set; }
}

View File

@@ -0,0 +1,14 @@
namespace Dlhis.InfoCheck.Api.Response;
public class FaceRecognizeResponse
{
/// <summary>
/// 相似度
/// </summary>
public float Similarity { get; set; }
/// <summary>
/// 同一人
/// </summary>
public bool IsSelf { get; set; }
}

View File

@@ -1,14 +1,18 @@
namespace Dlhis.InfoCheck.Request;
using System.ComponentModel.DataAnnotations;
namespace Dlhis.InfoCheck.Request;
public class FaceRecognizeRequest
{
/// <summary>
/// 第一张图片
/// </summary>
[Required]
public string FirstBase64 { get; set; }
/// <summary>
/// 第二张图片
/// </summary>
[Required]
public string SecondBase64 { get; set; }
}
}