From c4106b8d898bb06ee808b58170c9a39887bfcd4b Mon Sep 17 00:00:00 2001 From: Gabriel Borlea Date: Thu, 12 May 2022 14:30:47 +0300 Subject: [PATCH] fix(face-landmarks) set explicit model paths --- .../face-landmarks/faceLandmarksWorker.ts | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/react/features/face-landmarks/faceLandmarksWorker.ts b/react/features/face-landmarks/faceLandmarksWorker.ts index a90776125..47087ff0a 100644 --- a/react/features/face-landmarks/faceLandmarksWorker.ts +++ b/react/features/face-landmarks/faceLandmarksWorker.ts @@ -59,12 +59,16 @@ const config: Partial = { face: { enabled: true, detector: { - enabled: true, - rotation: false + enabled: false, + rotation: false, + modelPath: 'blazeface-front.json' }, mesh: { enabled: false }, iris: { enabled: false }, - emotion: { enabled: false }, + emotion: { + enabled: false, + modelPath: 'emotion.json' + }, description: { enabled: false } }, hand: { enabled: false }, @@ -147,9 +151,19 @@ const init = async ({ baseUrl, detectionTypes }: InitInput) => { config.wasmPath = baseUrl; setWasmPaths(baseUrl); } - if (detectionTypes.includes(DETECTION_TYPES.FACE_EXPRESSIONS) && config.face) { - config.face.emotion = { enabled: true }; + + if (detectionTypes.length > 0 && config.face) { + config.face.enabled = true + } + + if (detectionTypes.includes(DETECTION_TYPES.FACE_BOX) && config.face?.detector) { + config.face.detector.enabled = true; } + + if (detectionTypes.includes(DETECTION_TYPES.FACE_EXPRESSIONS) && config.face?.emotion) { + config.face.emotion.enabled = true; + } + const initialHuman = new Human(config); try { await initialHuman.load();