From 6c198b07e0e31a4006729e04667d524a690038fd Mon Sep 17 00:00:00 2001 From: Moe Date: Thu, 9 Aug 2018 13:17:30 -0700 Subject: [PATCH] no stream_loop flag for anything other than mp4 and local inputs --- camera.js | 4 +- plugins/python-yolo/INSTALL.sh | 67 ++++++++++++++++---------------- web/pages/blocks/monitoredit.ejs | 2 +- 3 files changed, 37 insertions(+), 36 deletions(-) diff --git a/camera.js b/camera.js index 3d752ae8..030d817d 100644 --- a/camera.js +++ b/camera.js @@ -1501,7 +1501,7 @@ s.createInputMap = function(e,number,input){ //input - probe size if(input.probesize&&input.probesize!==''){x.cust_input+=' -probesize '+input.probesize} //input - stream loop (good for static files/lists) - if(input.stream_loop==='1'){x.cust_input+=' -stream_loop -1'} + if(input.stream_loop === '1'){x.cust_input+=' -stream_loop -1'} //input - fps if(x.cust_input.indexOf('-r ')===-1&&input.sfps&&input.sfps!==''){ input.sfps=parseFloat(input.sfps); @@ -1944,7 +1944,7 @@ s.ffmpeg = function(e){ //input - probe size if(e.details.probesize&&e.details.probesize!==''){x.cust_input+=' -probesize '+e.details.probesize}; //input - stream loop (good for static files/lists) - if(e.details.stream_loop==='1'){x.cust_input+=' -stream_loop -1'}; + if(e.details.stream_loop === '1' && (e.type === 'mp4' || e.type === 'local')){x.cust_input+=' -stream_loop -1'}; //input if(e.details.cust_input.indexOf('-fflags') === -1){x.cust_input+=' -fflags +igndts'} switch(e.type){ diff --git a/plugins/python-yolo/INSTALL.sh b/plugins/python-yolo/INSTALL.sh index c1c94d65..ef32c6d4 100644 --- a/plugins/python-yolo/INSTALL.sh +++ b/plugins/python-yolo/INSTALL.sh @@ -2,6 +2,39 @@ echo "-----------------------------------------------" echo "-- Installing Python Yolo Plugin for Shinobi --" echo "-----------------------------------------------" +echo "-----------------------------------" +if [ ! -d "weights" ]; then + echo "Downloading yolov3 weights..." + mkdir weights + wget -O weights/yolov3.weights https://pjreddie.com/media/files/yolov3.weights +else + echo "yolov3 weights found..." +fi +echo "-----------------------------------" +if [ ! -d "cfg" ]; then + echo "Downloading yolov3 cfg" + mkdir cfg + wget -O cfg/coco.data https://raw.githubusercontent.com/pjreddie/darknet/master/cfg/coco.data + wget -O cfg/yolov3.cfg https://raw.githubusercontent.com/pjreddie/darknet/master/cfg/yolov3.cfg +else + echo "yolov3 cfg found..." +fi +echo "-----------------------------------" +if [ ! -d "data" ]; then + echo "Downloading yolov3 data" + mkdir data + wget -O data/coco.names https://raw.githubusercontent.com/pjreddie/darknet/master/data/coco.names +else + echo "yolov3 data found..." +fi +echo "-----------------------------------" +if [ ! -e "./conf.json" ]; then + echo "Creating conf.json" + sudo cp conf.sample.json conf.json +else + echo "conf.json already exists..." +fi +echo "-----------------------------------" sudo apt update -y sudo apt-get install libxml2-dev libxslt-dev libxslt1-dev zlib1g-dev -y if ! [ -x "$(command -v python3)" ]; then @@ -52,6 +85,7 @@ echo "Getting new pip..." pip3 install --upgrade pip pip install --user --upgrade pip echo "Smoking pips..." +pip3 install flask_socketio pip3 install flask pip3 install numpy export PATH=/usr/local/cuda/bin:$PATH @@ -74,38 +108,5 @@ pip3 install . apt remove libpython-all-dev python-all python-all-dev python-asn1crypto python-cffi-backend python-crypto python-cryptography python-dbus python-enum34 python-gi python-idna python-ipaddress python-keyring python-keyrings.alt python-pkg-resources python-secretstorage python-setuptools python-six python-wheel python-xdg -y echo "Done Installing Darknet..." export PATH=/opt/darknet:$PATH -echo "-----------------------------------" -if [ ! -d "weights" ]; then - echo "Downloading yolov3 weights..." - mkdir weights - wget -O weights/yolov3.weights https://pjreddie.com/media/files/yolov3.weights -else - echo "yolov3 weights found..." -fi -echo "-----------------------------------" -if [ ! -d "cfg" ]; then - echo "Downloading yolov3 cfg" - mkdir cfg - wget -O cfg/coco.data https://raw.githubusercontent.com/pjreddie/darknet/master/cfg/coco.data - wget -O cfg/yolov3.cfg https://raw.githubusercontent.com/pjreddie/darknet/master/cfg/yolov3.cfg -else - echo "yolov3 cfg found..." -fi -echo "-----------------------------------" -if [ ! -d "data" ]; then - echo "Downloading yolov3 data" - mkdir data - wget -O data/coco.names https://raw.githubusercontent.com/pjreddie/darknet/master/data/coco.names -else - echo "yolov3 data found..." -fi -echo "-----------------------------------" -if [ ! -e "./conf.json" ]; then - echo "Creating conf.json" - sudo cp conf.sample.json conf.json -else - echo "conf.json already exists..." -fi -echo "-----------------------------------" echo "Start the plugin with pm2 like so :" echo "pm2 start shinobi-python-yolo.js" \ No newline at end of file diff --git a/web/pages/blocks/monitoredit.ejs b/web/pages/blocks/monitoredit.ejs index 6263243a..0569d441 100644 --- a/web/pages/blocks/monitoredit.ejs +++ b/web/pages/blocks/monitoredit.ejs @@ -208,7 +208,7 @@
-
+