摄像头管理页面增删改查成功

master
hush_goup 2023-03-28 19:56:35 +08:00
commit 8ef0887800
2 changed files with 23 additions and 2 deletions

View File

@ -107,8 +107,13 @@ 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 apiUrltest = "192.168.1.196:5403/compare";
=======
// String apiUrl = apiServerPrefix + ApiUrlEnum.FACE_COMPARISON.getUrl();
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));
@ -116,10 +121,22 @@ 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.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());
// }
>>>>>>> 26aceca82a102504f904715404a73aa391abac98
} }
// if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO)) { // if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO)) {
// if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO.getFaces())) { // if (UtilValidate.isNotEmpty(apiFaceOneSearchReturnFaceVO.getFaces())) {
@ -142,7 +159,7 @@ public class CompareServiceImpl implements ICompareService {
throw new DkException("文件上传失败"); throw new DkException("文件上传失败");
} }
String imag = map1.getString("url"); String imag = map1.getString("url");
//人脸检测方法 //人脸检测方法入口
validateSingleFaceImage(imag); validateSingleFaceImage(imag);
return imag; return imag;
@ -167,7 +184,11 @@ 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";
>>>>>>> 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);

View File

@ -110,7 +110,7 @@ renren.redis.open: false
#人脸API统一请求地址定义 #人脸API统一请求地址定义
api: api:
server: server:
prefix: http://192.168.1.161:8013/dkha/ prefix: http://192.168.1.196:5001/
#人脸检索最大返回值 #人脸检索最大返回值
max: max:
result: 100 result: 100