Pārlūkot izejas kodu

新活检:补充日志

Michael Wang 5 gadi atpakaļ
vecāks
revīzija
a34d06f3d6

+ 21 - 7
src/features/OnlineExam/Examing/FaceMotion/FaceMotion.vue

@@ -565,10 +565,17 @@ export default {
           .withFaceLandmarks();
       }
 
-      // console.log(result);
+      const detectEndTime = performance.now();
+      console.log(
+        "live single detect time: ",
+        detectEndTime - detectStartTime,
+        " --- ",
+        result && result.length
+      );
       if (result && result.length >= 2) {
         this.corFinalResult.result = false;
         this.corFinalResult.errorMsg = "检测过程中多人脸失败";
+        console.log("检测过程中多人脸失败");
         this.failedTest("检测到多张人脸!活体检测失败!");
       }
 
@@ -583,6 +590,7 @@ export default {
         ) {
           this.corFinalResult.result = false;
           this.corFinalResult.errorMsg = "检测过程人脸晃出摄像头";
+          console.log("检测过程人脸晃出摄像头");
           this.failedTest("活检过程中没有检测到人脸!活体检测失败!");
         }
       }
@@ -661,6 +669,7 @@ export default {
               this.$Message.warning({ content: message, duration: 1 });
             }, 1500);
           this.tipHandler(message);
+          console.log(message);
           if (this.shoudAdjustDistance) {
             setTimeout(() => this.onPlay(), 300);
             return;
@@ -674,7 +683,7 @@ export default {
               if (this.pauseDetecting || this.doneCompare) return;
               this.pauseDetecting = true;
               const cs = await this.snap();
-              console.log(cs);
+              console.log("得到比对结果");
               if (!cs) return;
               this.compareResult = cs;
               // 后台的计算需要通过resultJson来判断: isPass isStranger existsSystemError
@@ -724,6 +733,9 @@ export default {
                   content: this.currentStep.happy ? "请保持微笑" : "请保持严肃",
                   duration: 1,
                 });
+                console.log(
+                  this.currentStep.happy ? "请保持微笑" : "请保持严肃"
+                );
                 setTimeout(() => this.onPlay(), 1000);
                 return;
               }
@@ -746,11 +758,6 @@ export default {
             }, 3000);
           }
         }
-        const detectEndTime = performance.now();
-        console.log(
-          "live single detect time: ",
-          detectEndTime - detectStartTime
-        );
         if (this.shouldDetectExpression && this.behavingStartDate) {
           // 到指定区块后才开始检测表情
           if (result.expressions.happy < 0.5 && this.currentStep.happy) {
@@ -762,6 +769,9 @@ export default {
                   content: this.currentStep.happy ? "请保持微笑" : "请保持严肃",
                   duration: 1,
                 });
+                console.log(
+                  this.currentStep.happy ? "请保持微笑" : "请保持严肃"
+                );
               }
             }
           }
@@ -783,12 +793,16 @@ export default {
                   content: this.currentStep.happy ? "请保持微笑" : "请保持严肃",
                   duration: 1,
                 });
+                console.log(
+                  this.currentStep.happy ? "请保持微笑" : "请保持严肃"
+                );
               }
             }
           }
           if (this.happyFailedTimes / this.totalDetectTimes >= 0.4) {
             this.corFinalResult.result = false;
             this.corFinalResult.errorMsg = "动作错误";
+            console.log("动作错误");
             this.failedTest("指定表情失败!活体检测失败!");
           }
         }