فهرست منبع

ignore update..

deason 11 ماه پیش
والد
کامیت
9b38738180

+ 4 - 4
examcloud-starters/examcloud-face-verify-starter/src/main/java/cn/com/qmth/examcloud/starters/face/verify/FaceVerifyProperties.java

@@ -33,22 +33,22 @@ public class FaceVerifyProperties implements Serializable {
     private String baiduSecret;
     private String baiduSecret;
 
 
     /*
     /*
-     * 百度 私有化部署 是否启用
+     * 百度 私有化部署API 是否启用
      */
      */
     private Boolean baiduLocalEnabled = false;
     private Boolean baiduLocalEnabled = false;
 
 
     /*
     /*
-     * 百度 私有化部署 appId
+     * 百度 私有化部署API appId
      */
      */
     private String baiduLocalAppId;
     private String baiduLocalAppId;
 
 
     /*
     /*
-     * 百度 私有化部署 接口地址前缀
+     * 百度 私有化部署API 接口地址前缀
      */
      */
     private String baiduLocalUrlPrefix;
     private String baiduLocalUrlPrefix;
 
 
     /*
     /*
-     * 百度 人脸相似度得分(自定义期望通过阈值
+     * 百度 自定义人脸相似度期望通过阈值
      */
      */
     private Double baiduExpectFaceCompareScore = 70d;
     private Double baiduExpectFaceCompareScore = 70d;
 
 

+ 2 - 2
examcloud-starters/examcloud-face-verify-starter/src/main/java/cn/com/qmth/examcloud/starters/face/verify/common/Constants.java

@@ -20,7 +20,7 @@ public interface Constants {
     String BAIDU_TOKEN_URL = "https://aip.baidubce.com/oauth/2.0/token";
     String BAIDU_TOKEN_URL = "https://aip.baidubce.com/oauth/2.0/token";
 
 
     /*
     /*
-     * 百度 人脸活体检测接口
+     * 百度 人脸真实性检测接口
      */
      */
     String BAIDU_FACE_VERIFY_URL = "https://aip.baidubce.com/rest/2.0/face/v3/faceverify";
     String BAIDU_FACE_VERIFY_URL = "https://aip.baidubce.com/rest/2.0/face/v3/faceverify";
 
 
@@ -35,7 +35,7 @@ public interface Constants {
     String BAIDU_FACE_COMPARE_URL = "https://aip.baidubce.com/rest/2.0/face/v3/match";
     String BAIDU_FACE_COMPARE_URL = "https://aip.baidubce.com/rest/2.0/face/v3/match";
 
 
     /*
     /*
-     * 百度 人脸活体检测接口(本地化部署)
+     * 百度 人脸真实性检测接口(本地化部署)
      */
      */
     String BAIDU_FACE_VERIFY_LOCAL_URL = "/face-api/v3/face/liveness";
     String BAIDU_FACE_VERIFY_LOCAL_URL = "/face-api/v3/face/liveness";
 
 

+ 64 - 0
examcloud-starters/examcloud-face-verify-starter/src/main/java/cn/com/qmth/examcloud/starters/face/verify/model/param/FaceApiParam.java

@@ -0,0 +1,64 @@
+package cn.com.qmth.examcloud.starters.face.verify.model.param;
+
+import java.io.Serializable;
+
+/**
+ * 人脸相关接口的常用参数
+ */
+public class FaceApiParam implements Serializable {
+
+    private static final long serialVersionUID = 3440291316492301402L;
+
+    /**
+     * 人脸API类型
+     */
+    private FaceApiType apiType;
+
+    /**
+     * 人脸图片集合
+     */
+    private ImageParm[] images;
+
+    /**
+     * 自定义人脸相似度期望通过的阈值
+     */
+    private Double expectFaceCompareScore;
+
+    public FaceApiParam(FaceApiType apiType) {
+        if (apiType == null) {
+            throw new IllegalArgumentException("人脸API类型不能为空!");
+        }
+        this.apiType = apiType;
+    }
+
+    public FaceApiParam apiType(FaceApiType apiType) {
+        if (apiType == null) {
+            throw new IllegalArgumentException("人脸API类型不能为空!");
+        }
+        this.apiType = apiType;
+        return this;
+    }
+
+    public FaceApiParam images(ImageParm... images) {
+        this.images = images;
+        return this;
+    }
+
+    public FaceApiParam expectFaceCompareScore(Double expectFaceCompareScore) {
+        this.expectFaceCompareScore = expectFaceCompareScore;
+        return this;
+    }
+
+    public FaceApiType getApiType() {
+        return apiType;
+    }
+
+    public ImageParm[] getImages() {
+        return images;
+    }
+
+    public Double getExpectFaceCompareScore() {
+        return expectFaceCompareScore;
+    }
+
+}

+ 20 - 0
examcloud-starters/examcloud-face-verify-starter/src/main/java/cn/com/qmth/examcloud/starters/face/verify/model/param/FaceApiType.java

@@ -0,0 +1,20 @@
+package cn.com.qmth.examcloud.starters.face.verify.model.param;
+
+public enum FaceApiType {
+
+    /**
+     * 旷世 Face++
+     */
+    FACE_PLUS,
+
+    /**
+     * 百度在线API
+     */
+    BAIDU_API,
+
+    /**
+     * 百度私有化部署API
+     */
+    BAIDU_LOCAL_API;
+
+}

+ 3 - 1
examcloud-starters/examcloud-face-verify-starter/src/main/java/cn/com/qmth/examcloud/starters/face/verify/model/param/ImageParm.java

@@ -1,6 +1,8 @@
 package cn.com.qmth.examcloud.starters.face.verify.model.param;
 package cn.com.qmth.examcloud.starters.face.verify.model.param;
 
 
-public interface ImageParm {
+import java.io.Serializable;
+
+public interface ImageParm extends Serializable {
 
 
     String value();
     String value();
 
 

+ 1 - 1
examcloud-starters/examcloud-face-verify-starter/src/main/java/cn/com/qmth/examcloud/starters/face/verify/service/FaceVerifyService.java

@@ -6,7 +6,7 @@ import cn.com.qmth.examcloud.starters.face.verify.model.param.ImageParm;
 public interface FaceVerifyService {
 public interface FaceVerifyService {
 
 
     /**
     /**
-     * 百度 人脸活体检测(不支持陌生人检测)
+     * 百度 人脸真实性检测(不支持陌生人检测)
      */
      */
     FaceResult faceVerifyByBaidu(ImageParm image);
     FaceResult faceVerifyByBaidu(ImageParm image);