From 26aceca82a102504f904715404a73aa391abac98 Mon Sep 17 00:00:00 2001 From: coco1986509808 <1986509808@qq.com> Date: Tue, 28 Mar 2023 19:44:32 +0800 Subject: [PATCH] =?UTF-8?q?3.28=E4=BF=AE=E6=94=B9=E4=BA=BA=E8=84=B8?= =?UTF-8?q?=E6=AF=94=E5=AF=B9=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/impl/CompareServiceImpl.java | 21 ++++++++----------- .../src/main/resources/application-dev.yml | 2 +- 2 files changed, 10 insertions(+), 13 deletions(-) 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..b650d35 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 @@ -108,22 +108,23 @@ public class CompareServiceImpl implements ICompareService { throw new DkException("请上传1:1比对的两张图片"); } // String apiUrl = apiServerPrefix + ApiUrlEnum.FACE_COMPARISON.getUrl(); - String apiUrltest = "192.168.1.196:5403/compare"; + String apiUrltest = "http://192.168.1.196:5001/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()); - } +// if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO.getFaces())) { +// for (ApiFaceOneSearchFaceVO apiFaceOneSearchFaceVO : apiFaceOneSearchReturnFaceVO.getFaces()) { +// oneToOneResultVo.getUrls().add(apiFaceOneSearchFaceVO.getUrl()); +// } + oneToOneResultVo.getUrls().add(faceCompareVO.getImage1()); + oneToOneResultVo.getUrls().add(faceCompareVO.getImage1()); oneToOneResultVo.setScore(apiFaceOneSearchReturnFaceVO.getHitSimilarity()); - } +// } } return oneToOneResultVo; } @@ -138,7 +139,7 @@ public class CompareServiceImpl implements ICompareService { throw new DkException("文件上传失败"); } String imag = map1.getString("url"); - //人脸检测方法 + //人脸检测方法入口 validateSingleFaceImage(imag); return imag; @@ -163,10 +164,6 @@ 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"; //组装api请求数据 ReturnVO returnVO; diff --git a/face-server/src/main/resources/application-dev.yml b/face-server/src/main/resources/application-dev.yml index 1089f2f..ad84e57 100644 --- a/face-server/src/main/resources/application-dev.yml +++ b/face-server/src/main/resources/application-dev.yml @@ -110,7 +110,7 @@ renren.redis.open: false #人脸API统一请求地址定义 api: server: - prefix: http://192.168.1.161:8013/dkha/ + prefix: http://192.168.1.196:5001/ #人脸检索最大返回值 max: result: 100