mirror of
https://gitee.com/open-visual/face-search.git
synced 2025-07-10 19:37:01 +08:00
update:添加人脸比对1:1的接口服务
This commit is contained in:
parent
2fbb092926
commit
1be896876d
@ -28,11 +28,11 @@ public class FaceCompareServiceImpl implements FaceCompareService {
|
||||
public FaceCompareRepVo faceCompare(FaceCompareReqVo compareReq) {
|
||||
FaceInfo faceInfoA = getFaceInfo(compareReq.getFaceScoreThreshold(), compareReq.getImageBase64A());
|
||||
if(null == faceInfoA){
|
||||
throw new RuntimeException("image A is not face");
|
||||
throw new RuntimeException("Image A is not face");
|
||||
}
|
||||
FaceInfo faceInfoB = getFaceInfo(compareReq.getFaceScoreThreshold(), compareReq.getImageBase64B());
|
||||
if(null == faceInfoB){
|
||||
throw new RuntimeException("image B is not face");
|
||||
throw new RuntimeException("Image B is not face");
|
||||
}
|
||||
//计算余弦相似度
|
||||
float simVal = Similarity.cosineSimilarity(faceInfoA.embedding.embeds, faceInfoA.embedding.embeds);
|
||||
|
Loading…
x
Reference in New Issue
Block a user