From 57d2e3879df55bfafa184e1d9c457651784d3725 Mon Sep 17 00:00:00 2001 From: Elad Bar Date: Fri, 9 Dec 2022 22:17:27 +0200 Subject: [PATCH] Fix plugin configuration --- plugins/deepstack-face/shinobi-deepstack-face.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/plugins/deepstack-face/shinobi-deepstack-face.js b/plugins/deepstack-face/shinobi-deepstack-face.js index 65913e16..25eaab9c 100644 --- a/plugins/deepstack-face/shinobi-deepstack-face.js +++ b/plugins/deepstack-face/shinobi-deepstack-face.js @@ -113,12 +113,12 @@ const initialize = () => { const detectionType = config.plug.split("-")[1].toLowerCase(); const detectorConfig = DETECTOR_CONFIGUTATION[detectionType]; const detectorConfigKeys = Object.keys(detectorConfig); - detectorSettings = { type: detectionType, active: false, baseUrl: baseUrl, apiKey: config.deepStack.apiKey, + fullyControlledByFaceManager: config.fullyControlledByFaceManager || false, faces: { shinobi: null, server: null, @@ -195,6 +195,10 @@ const registerFace = (serverFileName) => { }; const unregisterFace = (serverFileName) => { + if (serverFileName === null) { + return; + } + const form = { userid: serverFileName }; @@ -216,12 +220,12 @@ const getServerFileNameByShinobi = (name, image) => { return fileName; } -const compareShinobiVSServer = () => { +const compareShinobiVSServer = () => { const allFaces = detectorSettings.faces; const shinobiFaces = allFaces.shinobi; const serverFaces = allFaces.server; const compareShinobiVSServerDelayID = detectorSettings.compareShinobiVSServerDelayID || null; - + if (compareShinobiVSServerDelayID !== null) { clearTimeout(compareShinobiVSServerDelayID) } @@ -268,8 +272,9 @@ const compareShinobiVSServer = () => { logInfo(`Skip unregistering the following faces: ${facesToUnregister}`); detectorSettings.faces.legacy = facesToUnregister; - } + } } + }; const processImage = (frameBuffer, d, tx, frameLocation, callback) => { @@ -517,8 +522,8 @@ const onRecompileFaceDescriptors = (d) => { if(detectorSettings.faces.shinobi !== d.faces) { detectorSettings.faces.shinobi = d.faces; detectorSettings.facesPath = d.path; - compareShinobiVSServer(); + } };