diff --git a/Dockerfile b/Dockerfile index cb1a591f..0bbb6fdb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -99,7 +99,6 @@ RUN sed -i -e 's/\r//g' /home/Shinobi/Docker/init.sh # RUN chmod -f +x /home/Shinobi/shinobi VOLUME ["/home/Shinobi/videos"] -VOLUME ["/home/Shinobi/plugins"] VOLUME ["/home/Shinobi/libs/customAutoLoad"] VOLUME ["/config"] VOLUME ["/var/lib/mysql"] diff --git a/Dockerfile.arm32v7 b/Dockerfile.arm32v7 index aa7c6aa9..eed0ba2a 100644 --- a/Dockerfile.arm32v7 +++ b/Dockerfile.arm32v7 @@ -97,7 +97,6 @@ COPY ./Docker/pm2.yml ./ RUN chmod -f +x /home/Shinobi/Docker/init.sh VOLUME ["/home/Shinobi/videos"] -VOLUME ["/home/Shinobi/plugins"] VOLUME ["/home/Shinobi/libs/customAutoLoad"] VOLUME ["/config"] VOLUME ["/var/lib/mysql"] diff --git a/Dockerfile.nvidia b/Dockerfile.nvidia index b2b7ff65..529d41b4 100644 --- a/Dockerfile.nvidia +++ b/Dockerfile.nvidia @@ -106,7 +106,6 @@ RUN sed -i -e 's/\r//g' /home/Shinobi/Docker/init.sh # RUN chmod -f +x /home/Shinobi/shinobi VOLUME ["/home/Shinobi/videos"] -VOLUME ["/home/Shinobi/plugins"] VOLUME ["/home/Shinobi/libs/customAutoLoad"] VOLUME ["/config"] VOLUME ["/var/lib/mysql"] diff --git a/plugins/deepstack-face/shinobi-deepstack-face.js b/plugins/deepstack-face/shinobi-deepstack-face.js index cd634988..63da2f92 100644 --- a/plugins/deepstack-face/shinobi-deepstack-face.js +++ b/plugins/deepstack-face/shinobi-deepstack-face.js @@ -1,4 +1,3 @@ -// // Shinobi - DeepStack Face Recognition Plugin // Copyright (C) 2021 Elad Bar // @@ -173,7 +172,7 @@ const initialize = () => { }); }; -const processImage = (imageB64, d, tx, frameLocation, callback) => { +const processImage = (frameBuffer, d, tx, frameLocation, callback) => { if(!detectorSettings.active) { return; } @@ -195,7 +194,7 @@ const processImage = (imageB64, d, tx, frameLocation, callback) => { res.duration = getDuration(requestTime); } - onImageProcessed(d, tx, err, res, body, imageB64); + onImageProcessed(d, tx, err, res, body, frameBuffer); fs.unlinkSync(frameLocation); }); @@ -221,21 +220,19 @@ const detectObject = (frameBuffer, d, tx, frameLocation, callback) => { d.dir = `${s.dir.streams}${d.ke}/${d.id}/`; - frameLocation = `${d.dir}${s.gid(5)}.jpg`; + const filePath = `${d.dir}${s.gid(5)}.jpg`; if(!fs.existsSync(d.dir)) { fs.mkdirSync(d.dir, dirCreationOptions); } - fs.writeFile(frameLocation, frameBuffer, function(err) { + fs.writeFile(filePath, frameBuffer, function(err) { if(err) { return s.systemLog(err); } try { - const imageB64 = frameBuffer.toString('base64'); - - processImage(imageB64, d, tx, frameLocation, callback); + processImage(frameBuffer, d, tx, filePath, callback); } catch(ex) { logError(`Detector failed to parse frame, Error: ${ex}`); @@ -279,7 +276,7 @@ const onFaceListResult = (err, res, body) => { } }; -const onImageProcessed = (d, tx, err, res, body, imageStream) => { +const onImageProcessed = (d, tx, err, res, body, frameBuffer) => { const duration = !!res ? res.duration : 0; let objects = []; @@ -338,7 +335,7 @@ const onImageProcessed = (d, tx, err, res, body, imageStream) => { imgWidth: height, time: duration }, - frame: imageStream + frame: frameBuffer }; tx(eventData); diff --git a/plugins/deepstack-object/shinobi-deepstack-object.js b/plugins/deepstack-object/shinobi-deepstack-object.js index 54acd144..62474268 100644 --- a/plugins/deepstack-object/shinobi-deepstack-object.js +++ b/plugins/deepstack-object/shinobi-deepstack-object.js @@ -1,5 +1,5 @@ // -// Shinobi - DeepStack Face Recognition Plugin +// Shinobi - DeepStack Object Detection Plugin // Copyright (C) 2021 Elad Bar // // Base Init >> @@ -173,7 +173,7 @@ const initialize = () => { }); }; -const processImage = (imageB64, d, tx, frameLocation, callback) => { +const processImage = (frameBuffer, d, tx, frameLocation, callback) => { if(!detectorSettings.active) { return; } @@ -195,7 +195,7 @@ const processImage = (imageB64, d, tx, frameLocation, callback) => { res.duration = getDuration(requestTime); } - onImageProcessed(d, tx, err, res, body, imageB64); + onImageProcessed(d, tx, err, res, body, frameBuffer); fs.unlinkSync(frameLocation); }); @@ -221,21 +221,19 @@ const detectObject = (frameBuffer, d, tx, frameLocation, callback) => { d.dir = `${s.dir.streams}${d.ke}/${d.id}/`; - frameLocation = `${d.dir}${s.gid(5)}.jpg`; + const filePath = `${d.dir}${s.gid(5)}.jpg`; if(!fs.existsSync(d.dir)) { fs.mkdirSync(d.dir, dirCreationOptions); } - fs.writeFile(frameLocation, frameBuffer, function(err) { + fs.writeFile(filePath, frameBuffer, function(err) { if(err) { return s.systemLog(err); } try { - const imageB64 = frameBuffer.toString('base64'); - - processImage(imageB64, d, tx, frameLocation, callback); + processImage(frameBuffer, d, tx, filePath, callback); } catch(ex) { logError(`Detector failed to parse frame, Error: ${ex}`); @@ -279,7 +277,7 @@ const onFaceListResult = (err, res, body) => { } }; -const onImageProcessed = (d, tx, err, res, body, imageStream) => { +const onImageProcessed = (d, tx, err, res, body, frameBuffer) => { const duration = !!res ? res.duration : 0; let objects = []; @@ -338,7 +336,7 @@ const onImageProcessed = (d, tx, err, res, body, imageStream) => { imgWidth: height, time: duration }, - frame: imageStream + frame: frameBuffer }; tx(eventData);