|
@@ -13,7 +13,6 @@ import com.ktg.common.utils.StringUtils;
|
|
|
import com.ktg.common.vo.FaceCutVO;
|
|
import com.ktg.common.vo.FaceCutVO;
|
|
|
import com.ktg.common.vo.FaceMatchVO;
|
|
import com.ktg.common.vo.FaceMatchVO;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
@@ -37,8 +36,6 @@ import static com.arcsoft.face.toolkit.ImageFactory.getRGBData;
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
public class ArcSoftMothodUtil {
|
|
public class ArcSoftMothodUtil {
|
|
|
|
|
|
|
|
- @Value("${ktg-mes.prod}")
|
|
|
|
|
- private static String prodApi;
|
|
|
|
|
|
|
|
|
|
static FaceEngine faceEngine;
|
|
static FaceEngine faceEngine;
|
|
|
|
|
|
|
@@ -47,18 +44,22 @@ public class ArcSoftMothodUtil {
|
|
|
String appId;
|
|
String appId;
|
|
|
String sdkKey;
|
|
String sdkKey;
|
|
|
String libarcsoftFaceDllPath;
|
|
String libarcsoftFaceDllPath;
|
|
|
|
|
+ String prodApi = RuoYiConfig.getProd();
|
|
|
|
|
+ System.out.println("prodApi---" + prodApi);
|
|
|
if (StringUtils.isNotBlank(prodApi)) {
|
|
if (StringUtils.isNotBlank(prodApi)) {
|
|
|
// 在linux
|
|
// 在linux
|
|
|
appId = "J6z2Yp9rxSWXQbYo5bRPDP1ffgUEWEGJq6KZp2YWKH5t";
|
|
appId = "J6z2Yp9rxSWXQbYo5bRPDP1ffgUEWEGJq6KZp2YWKH5t";
|
|
|
sdkKey = "HcMT5xRseGbnGpazhXbCmTK9uvu2JwU8VuAJPG7n2teE";
|
|
sdkKey = "HcMT5xRseGbnGpazhXbCmTK9uvu2JwU8VuAJPG7n2teE";
|
|
|
- libarcsoftFaceDllPath = "/guoruan/app/ArcSoft_ArcFace_Java_Linux_x64_V3.0/libs/LINUX64";
|
|
|
|
|
|
|
+ libarcsoftFaceDllPath = "/usr/lib/ArcSoft_ArcFace_Java_Linux_x64_V3.0/libs/LINUX64";
|
|
|
} else {
|
|
} else {
|
|
|
// 在win
|
|
// 在win
|
|
|
appId = "5j9Uw8b5t9svFzVyVjBrCXtizjojgnjXJrNAg64UUYU4";
|
|
appId = "5j9Uw8b5t9svFzVyVjBrCXtizjojgnjXJrNAg64UUYU4";
|
|
|
sdkKey = "7yGfT9CQVmTrXfBmmPYeJTK3YTREQSTbM4XNVjPWzRbj";
|
|
sdkKey = "7yGfT9CQVmTrXfBmmPYeJTK3YTREQSTbM4XNVjPWzRbj";
|
|
|
libarcsoftFaceDllPath = "C:\\work\\app\\install\\ArcSoft_ArcFace_Java_Windows_x64_V3.0\\libs\\WIN64";
|
|
libarcsoftFaceDllPath = "C:\\work\\app\\install\\ArcSoft_ArcFace_Java_Windows_x64_V3.0\\libs\\WIN64";
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ System.out.println("appId-------" + appId);
|
|
|
|
|
+ System.out.println("sdkKey-------" + sdkKey);
|
|
|
|
|
+ System.out.println("libarcsoftFaceDllPath-------" + libarcsoftFaceDllPath);
|
|
|
faceEngine = new FaceEngine(libarcsoftFaceDllPath);
|
|
faceEngine = new FaceEngine(libarcsoftFaceDllPath);
|
|
|
//激活引擎
|
|
//激活引擎
|
|
|
int errorCode = faceEngine.activeOnline(appId, sdkKey);
|
|
int errorCode = faceEngine.activeOnline(appId, sdkKey);
|
|
@@ -105,6 +106,7 @@ public class ArcSoftMothodUtil {
|
|
|
*/
|
|
*/
|
|
|
public static FaceCutVO saveArcData(MultipartFile file, Long userId, String url) throws IOException {
|
|
public static FaceCutVO saveArcData(MultipartFile file, Long userId, String url) throws IOException {
|
|
|
int errorCode;
|
|
int errorCode;
|
|
|
|
|
+ String prodApi = RuoYiConfig.getProd();
|
|
|
// 1.判断这个文件是否有效
|
|
// 1.判断这个文件是否有效
|
|
|
Assert.isFalse(file.isEmpty(), "请上传人脸文件!");
|
|
Assert.isFalse(file.isEmpty(), "请上传人脸文件!");
|
|
|
// 2.-----------------开始存储上传的照片--------------------
|
|
// 2.-----------------开始存储上传的照片--------------------
|
|
@@ -168,6 +170,7 @@ public class ArcSoftMothodUtil {
|
|
|
|
|
|
|
|
public static FaceMatchVO completableFutureComparison(final MultipartFile file, final Set<String> matcher) throws IOException {
|
|
public static FaceMatchVO completableFutureComparison(final MultipartFile file, final Set<String> matcher) throws IOException {
|
|
|
int errorCode;
|
|
int errorCode;
|
|
|
|
|
+ String prodApi = RuoYiConfig.getProd();
|
|
|
// 提取当前人脸的特征值,比对文件零时存储,人脸存储基础路径
|
|
// 提取当前人脸的特征值,比对文件零时存储,人脸存储基础路径
|
|
|
String profile = RuoYiConfig.getProfile();
|
|
String profile = RuoYiConfig.getProfile();
|
|
|
String basePath = profile + "/face/" + 0 + "/";
|
|
String basePath = profile + "/face/" + 0 + "/";
|