|
|
@@ -4,6 +4,7 @@ import com.arcsoft.face.FaceFeature;
|
|
|
import com.arcsoft.face.FaceInfo;
|
|
|
import com.arcsoft.face.toolkit.ImageInfo;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
|
|
+import com.zd.alg.face.handle.FaceEngineFactory;
|
|
|
import com.zd.alg.face.service.FaceService;
|
|
|
import com.zd.alg.face.utils.FileUtil;
|
|
|
import com.zd.algorithm.api.face.feign.FaceCompare;
|
|
|
@@ -14,6 +15,9 @@ import com.zd.model.domain.R;
|
|
|
import com.zd.model.domain.ResultData;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.extern.flogger.Flogger;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
@@ -33,6 +37,8 @@ import java.util.List;
|
|
|
@RequestMapping("/faceApi")
|
|
|
public class FaceApi {
|
|
|
|
|
|
+ Logger logger = LoggerFactory.getLogger(FaceApi.class);
|
|
|
+
|
|
|
@Autowired
|
|
|
FaceService faceService;
|
|
|
|
|
|
@@ -66,14 +72,15 @@ public class FaceApi {
|
|
|
@PostMapping("/compare")
|
|
|
public ResultData faceDetection(@RequestBody FaceCompare faceCompare)
|
|
|
{
|
|
|
-
|
|
|
+ logger.info("====人脸比较====");
|
|
|
R<LabStudentsInfo> info = remoteStudentsService.getInfo(faceCompare.getUserId());
|
|
|
if(info.getCode()==200&&info.getData()!=null)
|
|
|
{
|
|
|
+ logger.info("====人脸data组装====");
|
|
|
FaceFeature target = new FaceFeature(info.getData().getFaceFeature());
|
|
|
FaceFeature source = new FaceFeature(faceCompare.getData());
|
|
|
Boolean compore = faceService.compore(target, source);
|
|
|
-
|
|
|
+ logger.info("====compore===="+compore);
|
|
|
return ResultData.result(compore,()->"人脸对比不符!");
|
|
|
}else
|
|
|
{
|