|
@@ -874,17 +874,28 @@ export default {
|
|
|
});
|
|
|
console.log(videoEl.readyState, faceapi.nets.tinyFaceDetector.params);
|
|
|
console.log("increaseTestSpeed --- doing faceapi");
|
|
|
- const result = await faceapi
|
|
|
- .detectSingleFace(videoEl, options)
|
|
|
- .withFaceLandmarks()
|
|
|
- .withFaceExpressions();
|
|
|
+ const result = await Promise.race([
|
|
|
+ faceapi
|
|
|
+ .detectSingleFace(videoEl, options)
|
|
|
+ .withFaceLandmarks()
|
|
|
+ .withFaceExpressions(),
|
|
|
+ new Promise(resolve => setTimeout(resolve, 20 * 1000)),
|
|
|
+ ]);
|
|
|
console.log("increaseTestSpeed --- result:", result);
|
|
|
+ this.$Spin.hide();
|
|
|
+ if (typeof result === "undefined") {
|
|
|
+ this.$Message.error({
|
|
|
+ content: "人脸检测功能不可用",
|
|
|
+ duration: 15,
|
|
|
+ closable: true,
|
|
|
+ });
|
|
|
+ this.logout("?LogoutReason=人脸检测功能不可用");
|
|
|
+ }
|
|
|
if (!result) {
|
|
|
console.log("increaseTestSpeed --- end failed");
|
|
|
} else {
|
|
|
console.log("increaseTestSpeed --- end successfully");
|
|
|
}
|
|
|
- this.$Spin.hide();
|
|
|
},
|
|
|
videoStartPlay() {
|
|
|
const video = document.getElementById("inputVideo");
|