From 0633723a810181dc8be5ac6b62a32ccff2f50805 Mon Sep 17 00:00:00 2001 From: hush_goup <514321690@qq.com> Date: Tue, 28 Mar 2023 19:53:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=91=84=E5=83=8F=E5=A4=B4=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=A2=9E=E5=88=A0=E6=94=B9=E6=9F=A5=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vo/face/ApiFaceOneSearchReturnFaceVO.java | 4 +-- .../services/impl/CompareServiceImpl.java | 28 +++++++++---------- .../services/impl/FaceCameraServiceImpl.java | 28 +++++++++---------- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceOneSearchReturnFaceVO.java b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceOneSearchReturnFaceVO.java index 86e245a..24cdc05 100644 --- a/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceOneSearchReturnFaceVO.java +++ b/face-common/src/main/java/com/dkha/common/modules/vo/face/ApiFaceOneSearchReturnFaceVO.java @@ -26,7 +26,7 @@ import java.util.List; public class ApiFaceOneSearchReturnFaceVO { private Double hitSimilarity; - private List faces; + //private List faces; - private String extraMeta; + // private String extraMeta; } diff --git a/face-server/src/main/java/com/dkha/server/services/impl/CompareServiceImpl.java b/face-server/src/main/java/com/dkha/server/services/impl/CompareServiceImpl.java index 2befdbb..2b70a3b 100644 --- a/face-server/src/main/java/com/dkha/server/services/impl/CompareServiceImpl.java +++ b/face-server/src/main/java/com/dkha/server/services/impl/CompareServiceImpl.java @@ -107,24 +107,28 @@ public class CompareServiceImpl implements ICompareService { if (compareRequestVo.getUrlList().size() != comparePicSize) { throw new DkException("请上传1:1比对的两张图片"); } -// String apiUrl = apiServerPrefix + ApiUrlEnum.FACE_COMPARISON.getUrl(); + // String apiUrl = apiServerPrefix + ApiUrlEnum.FACE_COMPARISON.getUrl(); String apiUrltest = "192.168.1.196:5403/compare"; FaceCompareVO faceCompareVO = new FaceCompareVO(); faceCompareVO.setImage1(compareRequestVo.getUrlList().get(0)); faceCompareVO.setImage2(compareRequestVo.getUrlList().get(1)); ReturnVO returnVO = (ReturnVO)httpUtil.post(apiUrltest, faceCompareVO, ReturnVO.class); - // ApiFaceOneSearchReturnFaceVO apiFaceOneSearchReturnFaceVO = JsonUtil.string2Obj(JsonUtil.obj2String(returnVO.getData()), new TypeReference() {}); //返回结果集 OneToOneResultVo oneToOneResultVo = new OneToOneResultVo(); - if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO)) { - if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO.getFaces())) { - for (ApiFaceOneSearchFaceVO apiFaceOneSearchFaceVO : apiFaceOneSearchReturnFaceVO.getFaces()) { - oneToOneResultVo.getUrls().add(apiFaceOneSearchFaceVO.getUrl()); - } - oneToOneResultVo.setScore(apiFaceOneSearchReturnFaceVO.getHitSimilarity()); - } + if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO)){ + oneToOneResultVo.getUrls().add(faceCompareVO.getImage1()); + oneToOneResultVo.getUrls().add(faceCompareVO.getImage2()); + oneToOneResultVo.setScore(apiFaceOneSearchReturnFaceVO.getHitSimilarity()); } +// if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO)) { +// if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO.getFaces())) { +// for (ApiFaceOneSearchFaceVO apiFaceOneSearchFaceVO : apiFaceOneSearchReturnFaceVO.getFaces()) { +// oneToOneResultVo.getUrls().add(apiFaceOneSearchFaceVO.getUrl()); +// } +// oneToOneResultVo.setScore(apiFaceOneSearchReturnFaceVO.getHitSimilarity()); +// } +// } return oneToOneResultVo; } @@ -163,11 +167,7 @@ public class CompareServiceImpl implements ICompareService { private void validateSingleFaceImage(String image) { //人脸检测url //String faceSearchUrl = apiRequestPrefix + ApiUrlEnum.FACE_SEARCH.getUrl(); -<<<<<<< HEAD - -======= ->>>>>>> 2694213e787f28783bce92eaa5a3db9102554981 - String faceSearchUrltest ="http://192.168.3.132:5000/message/mask"; + String faceSearchUrltest ="http://192.168.3.134:5000/message/mask"; //组装api请求数据 ReturnVO returnVO; returnVO = (ReturnVO) httpUtil.post(faceSearchUrltest + "?url=" + image, null, ReturnVO.class); diff --git a/face-server/src/main/java/com/dkha/server/services/impl/FaceCameraServiceImpl.java b/face-server/src/main/java/com/dkha/server/services/impl/FaceCameraServiceImpl.java index b3bbfb3..13df6ac 100644 --- a/face-server/src/main/java/com/dkha/server/services/impl/FaceCameraServiceImpl.java +++ b/face-server/src/main/java/com/dkha/server/services/impl/FaceCameraServiceImpl.java @@ -368,16 +368,16 @@ public class FaceCameraServiceImpl extends ServiceImpl