人脸识别处理

dev
wangpeng 2024-05-17 11:19:22 +08:00
parent 60deab8936
commit 07b6b55409
2 changed files with 6 additions and 1 deletions

View File

@ -192,6 +192,9 @@ public class AppUsersCacheController extends BaseController {
} }
MultipartFile coverpath = ImageUtil.getMultipartFile(Const.HTTPFILEURL + user.getString("COVERPATH")); MultipartFile coverpath = ImageUtil.getMultipartFile(Const.HTTPFILEURL + user.getString("COVERPATH"));
String USERAVATARURL = Base64Util.getBase64String(coverpath); String USERAVATARURL = Base64Util.getBase64String(coverpath);
System.out.println("---------------------------------------------------");
System.out.println(pd.getString("USERAVATARURL"));
System.out.println("---------------------------------------------------");
try { try {
String confidence = FaceUtil.compareFace(pd.getString("USERAVATARURL"), USERAVATARURL); String confidence = FaceUtil.compareFace(pd.getString("USERAVATARURL"), USERAVATARURL);
@ -221,8 +224,10 @@ public class AppUsersCacheController extends BaseController {
initPageDataUtil.initSaveApp(faceImg, pd.getString("USER_ID")); initPageDataUtil.initSaveApp(faceImg, pd.getString("USER_ID"));
// faceImg.put("IS_SUCCESS", 0); // faceImg.put("IS_SUCCESS", 0);
faceImgLogService.save(faceImg); faceImgLogService.save(faceImg);
map.put("result", errInfo); map.put("result", errInfo);
} }
return map; return map;
} catch (Exception e) { } catch (Exception e) {
System.out.println("----------" + e.getMessage()); System.out.println("----------" + e.getMessage());

View File

@ -11,7 +11,7 @@ public class Base64Util {
String baseStr = null; String baseStr = null;
BASE64Encoder encoder = new BASE64Encoder(); BASE64Encoder encoder = new BASE64Encoder();
baseStr = encoder.encode(multiPartFile.getBytes()); baseStr = encoder.encode(multiPartFile.getBytes());
baseStr = baseStr.replaceAll("\r\n", ""); baseStr = baseStr.replaceAll("\\r|\\n", "");
return baseStr; return baseStr;
} }
} }