Merge branch 'dev' of https://gitlab.com/Shinobi-Systems/Shinobi into dev
commit
9191eb8a08
|
|
@ -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"]
|
||||
|
|
|
|||
|
|
@ -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"]
|
||||
|
|
|
|||
|
|
@ -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"]
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue