From 1b3e63b7e7488214699c309ee6188906f61b82d9 Mon Sep 17 00:00:00 2001 From: junwei Date: Wed, 3 Apr 2024 12:18:01 +0800 Subject: [PATCH] remove the test-data --- common/utils.js | 6 +++--- face_recognition/main.js | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common/utils.js b/common/utils.js index 33a56e9b..a588fd8e 100644 --- a/common/utils.js +++ b/common/utils.js @@ -487,15 +487,15 @@ export function permuteData(array, dims, axes) { export function getDefaultLayout(deviceType) { const userAgent = navigator.userAgent; - if (userAgent.indexOf("Linux") != -1 || userAgent.indexOf("Android") != -1 || - userAgent.indexOf("CrOS") != -1) { + if (userAgent.indexOf('Linux') != -1 || userAgent.indexOf('Android') != -1 || + userAgent.indexOf('CrOS') != -1) { return 'nhwc'; } else { // Windows or Mac platform. if (deviceType.indexOf('cpu') != -1) { return 'nhwc'; } else if (deviceType.indexOf('gpu') != -1) { - return 'nchw' + return 'nchw'; } } } diff --git a/face_recognition/main.js b/face_recognition/main.js index 25bf8978..f212aa3c 100644 --- a/face_recognition/main.js +++ b/face_recognition/main.js @@ -50,6 +50,7 @@ $(document).ready(async () => { }); $('#backendBtns .btn').on('change', async (e) => { + if (inputType === 'camera') utils.stopCameraStream(rafReq, stream); layout = utils.getDefaultLayout($(e.target).attr('id')); await main(); });