update face-server/src/main/java/com/dkha/server/services/impl/CompareServiceImpl.java.
Signed-off-by: 风间琉璃大使 <1986509808@qq.com>master
parent
8ef0887800
commit
cb604b8495
|
@ -107,13 +107,8 @@ public class CompareServiceImpl implements ICompareService {
|
||||||
if (compareRequestVo.getUrlList().size() != comparePicSize) {
|
if (compareRequestVo.getUrlList().size() != comparePicSize) {
|
||||||
throw new DkException("请上传1:1比对的两张图片");
|
throw new DkException("请上传1:1比对的两张图片");
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
// String apiUrl = apiServerPrefix + ApiUrlEnum.FACE_COMPARISON.getUrl();
|
||||||
// String apiUrl = apiServerPrefix + ApiUrlEnum.FACE_COMPARISON.getUrl();
|
|
||||||
String apiUrltest = "192.168.1.196:5403/compare";
|
|
||||||
=======
|
|
||||||
// String apiUrl = apiServerPrefix + ApiUrlEnum.FACE_COMPARISON.getUrl();
|
|
||||||
String apiUrltest = "http://192.168.1.196:5001/compare";
|
String apiUrltest = "http://192.168.1.196:5001/compare";
|
||||||
>>>>>>> 26aceca82a102504f904715404a73aa391abac98
|
|
||||||
FaceCompareVO faceCompareVO = new FaceCompareVO();
|
FaceCompareVO faceCompareVO = new FaceCompareVO();
|
||||||
faceCompareVO.setImage1(compareRequestVo.getUrlList().get(0));
|
faceCompareVO.setImage1(compareRequestVo.getUrlList().get(0));
|
||||||
faceCompareVO.setImage2(compareRequestVo.getUrlList().get(1));
|
faceCompareVO.setImage2(compareRequestVo.getUrlList().get(1));
|
||||||
|
@ -121,12 +116,10 @@ public class CompareServiceImpl implements ICompareService {
|
||||||
ApiFaceOneSearchReturnFaceVO apiFaceOneSearchReturnFaceVO = JsonUtil.string2Obj(JsonUtil.obj2String(returnVO.getData()), new TypeReference<ApiFaceOneSearchReturnFaceVO>() {});
|
ApiFaceOneSearchReturnFaceVO apiFaceOneSearchReturnFaceVO = JsonUtil.string2Obj(JsonUtil.obj2String(returnVO.getData()), new TypeReference<ApiFaceOneSearchReturnFaceVO>() {});
|
||||||
//返回结果集
|
//返回结果集
|
||||||
OneToOneResultVo oneToOneResultVo = new OneToOneResultVo();
|
OneToOneResultVo oneToOneResultVo = new OneToOneResultVo();
|
||||||
<<<<<<< HEAD
|
|
||||||
if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO)){
|
if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO)){
|
||||||
oneToOneResultVo.getUrls().add(faceCompareVO.getImage1());
|
oneToOneResultVo.getUrls().add(faceCompareVO.getImage1());
|
||||||
oneToOneResultVo.getUrls().add(faceCompareVO.getImage2());
|
oneToOneResultVo.getUrls().add(faceCompareVO.getImage2());
|
||||||
oneToOneResultVo.setScore(apiFaceOneSearchReturnFaceVO.getHitSimilarity());
|
oneToOneResultVo.setScore(apiFaceOneSearchReturnFaceVO.getHitSimilarity());
|
||||||
=======
|
|
||||||
if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO)) {
|
if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO)) {
|
||||||
// if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO.getFaces())) {
|
// if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO.getFaces())) {
|
||||||
// for (ApiFaceOneSearchFaceVO apiFaceOneSearchFaceVO : apiFaceOneSearchReturnFaceVO.getFaces()) {
|
// for (ApiFaceOneSearchFaceVO apiFaceOneSearchFaceVO : apiFaceOneSearchReturnFaceVO.getFaces()) {
|
||||||
|
@ -136,7 +129,6 @@ public class CompareServiceImpl implements ICompareService {
|
||||||
oneToOneResultVo.getUrls().add(faceCompareVO.getImage1());
|
oneToOneResultVo.getUrls().add(faceCompareVO.getImage1());
|
||||||
oneToOneResultVo.setScore(apiFaceOneSearchReturnFaceVO.getHitSimilarity());
|
oneToOneResultVo.setScore(apiFaceOneSearchReturnFaceVO.getHitSimilarity());
|
||||||
// }
|
// }
|
||||||
>>>>>>> 26aceca82a102504f904715404a73aa391abac98
|
|
||||||
}
|
}
|
||||||
// if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO)) {
|
// if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO)) {
|
||||||
// if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO.getFaces())) {
|
// if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO.getFaces())) {
|
||||||
|
@ -184,11 +176,8 @@ public class CompareServiceImpl implements ICompareService {
|
||||||
private void validateSingleFaceImage(String image) {
|
private void validateSingleFaceImage(String image) {
|
||||||
//人脸检测url
|
//人脸检测url
|
||||||
//String faceSearchUrl = apiRequestPrefix + ApiUrlEnum.FACE_SEARCH.getUrl();
|
//String faceSearchUrl = apiRequestPrefix + ApiUrlEnum.FACE_SEARCH.getUrl();
|
||||||
<<<<<<< HEAD
|
|
||||||
String faceSearchUrltest ="http://192.168.3.134:5000/message/mask";
|
String faceSearchUrltest ="http://192.168.3.134:5000/message/mask";
|
||||||
=======
|
|
||||||
String faceSearchUrltest ="http://192.168.3.132:5000/message/mask";
|
String faceSearchUrltest ="http://192.168.3.132:5000/message/mask";
|
||||||
>>>>>>> 26aceca82a102504f904715404a73aa391abac98
|
|
||||||
//组装api请求数据
|
//组装api请求数据
|
||||||
ReturnVO returnVO;
|
ReturnVO returnVO;
|
||||||
returnVO = (ReturnVO) httpUtil.post(faceSearchUrltest + "?url=" + image, null, ReturnVO.class);
|
returnVO = (ReturnVO) httpUtil.post(faceSearchUrltest + "?url=" + image, null, ReturnVO.class);
|
||||||
|
|
Loading…
Reference in New Issue