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