[Support] spaceinvaderone - Shinobi Pro


Recommended Posts

Hey folks,

Awesome template @SpaceInvaderOne - thank you! 

 

Running the `:nvidia' tag as using a 1080 and it works well (RAM usage is a little high, but that's probably my settings, and i'm still tuning it). I used to use Shinobi and switched to Zoneminder as it has the ability to use the GPU for object detection.

Coming back to Shinobi i'm using the GPU for hardware acceleration, but it doesn't look like the object vision component (YOLO?) is leveraging the GPU? 

Is it possible, like dlandon's zoneminder docker, to add the ability for the GPU to use the object vision model (assume due to nvidia licensing we would have to compile openCV ourselves using the CUDA packages?) 

Link to comment
2 hours ago, Jaburges said:

Hey folks,

Awesome template @SpaceInvaderOne - thank you! 

 

Running the `:nvidia' tag as using a 1080 and it works well (RAM usage is a little high, but that's probably my settings, and i'm still tuning it). I used to use Shinobi and switched to Zoneminder as it has the ability to use the GPU for object detection.

Coming back to Shinobi i'm using the GPU for hardware acceleration, but it doesn't look like the object vision component (YOLO?) is leveraging the GPU? 

Is it possible, like dlandon's zoneminder docker, to add the ability for the GPU to use the object vision model (assume due to nvidia licensing we would have to compile openCV ourselves using the CUDA packages?) 

Replying to my own comment as I've been digging around. It looks like there is more in this docker image than initially thought (even more KUDOS!)
i couldnt tell what was GPU enabled and what was not - but running `sh INSTALL.sh` in the `plugins/tensorflow` directory gave me the option on reinstall to optimize for ARM64 (jetson) or for GPU. So did that :) 

Link to comment

is anyone having an issue trying to map the correct folder to ensure enabling tensorflow or face is persistent?

 

/config --> /mnt/user/appdata/shinobipro/config 

(this contains config, customautoload, database)

 

however the folder that I need to be persistent on the container are `/opt/shinobi`

Where the plugins are, but if I map that, i get an error regarding /opt/shinobi/run.sh 

 

thoughts?

 

Link to comment
14 minutes ago, Jaburges said:

is anyone having an issue trying to map the correct folder to ensure enabling tensorflow or face is persistent?

 

/config --> /mnt/user/appdata/shinobipro/config 

(this contains config, customautoload, database)

 

however the folder that I need to be persistent on the container are `/opt/shinobi`

Where the plugins are, but if I map that, i get an error regarding /opt/shinobi/run.sh 

 

thoughts?

 

 
 
 
 
 

solved it :)
i had to docker cp the contents to the intended mapped folder first (so run.sh was present) THEN map the folder

Link to comment
On 9/30/2020 at 2:37 AM, agusalex said:

Hey! @SpaceInvaderOne

since PTZ is broken for ShinobiPro and it has since been fixed, any chance on updating the image ?

https://gitlab.com/Shinobi-Systems/Shinobi/-/issues/200

I would gladly update and test this new image and make a PR but couldn't find your git repo with the Dockerfile 😬 

Love your work!

Cheers,

Augs

i have sucessfully mount one cam with ptz with onvif, the controls works and the cam folow person's, the problems:

my docker shinobi is using 40% cpu power :S i dont know why. i only have two cam's using yolo with gpu.

the feed of the cam have delay and the signal to move have a delay too, so the cam is always losing people, i think this problem is the cam and not shinobi.

 

there was been some updates to the docker shinobi gpu? because i install the gpu version and i dont see updates for very long time.

Link to comment
48 minutes ago, luixmod said:

i have sucessfully mount one cam with ptz with onvif, the controls works and the cam folow person's, the problems:

my docker shinobi is using 40% cpu power :S i dont know why. i only have two cam's using yolo with gpu.

the feed of the cam have delay and the signal to move have a delay too, so the cam is always losing people, i think this problem is the cam and not shinobi.

 

there was been some updates to the docker shinobi gpu? because i install the gpu version and i dont see updates for very long time.

how did you get yolo using GPU? i was under the impression that only tensorflow and face use GPU but yolo does not?

Link to comment
1 hour ago, Jaburges said:

how did you get yolo using GPU? i was under the impression that only tensorflow and face use GPU but yolo does not?

like this the exemple is on the description of the docker

Untitled.png

 

 

i have two cam one is hikvision and the outher is escam g02 something like that, with hikvision i get 4k and send to yolo 1920x1080 without problem and the docker uses 6% cpu, but with this chineses camera i cant get to work properly uses to much cpu like 20% dont acept h264 but on the site it is h264, and have a great delay, and the reason the cpu is high is this camera need decoding and transcoding with cpu, i cant put the gpu to decode or transcode the feed of this camera.

i advise you do not buy cheap cameras, only gets you problems..

Untitled.png

 

my next step is to change the weights, because this weights dont detect object detection at night. if someone could me advise on better weights, i appreciate.

Edited by luixmod
Link to comment
4 hours ago, luixmod said:

like this the exemple is on the description of the docker

Untitled.png

 

 

i have two cam one is hikvision and the outher is escam g02 something like that, with hikvision i get 4k and send to yolo 1920x1080 without problem and the docker uses 6% cpu, but with this chineses camera i cant get to work properly uses to much cpu like 20% dont acept h264 but on the site it is h264, and have a great delay, and the reason the cpu is high is this camera need decoding and transcoding with cpu, i cant put the gpu to decode or transcode the feed of this camera.

i advise you do not buy cheap cameras, only gets you problems..

Untitled.png

 

my next step is to change the weights, because this weights dont detect object detection at night. if someone could me advise on better weights, i appreciate.

weird - moeiscool on the discord (lead dev) mentioned that yolo is CPU based - looks like the docker this uses (MiGoller) has Yolo enabled for GPU
I ended up using tensorflow and face

Link to comment
23 hours ago, Jaburges said:

still doesnt solve it - none of the plugins survive a docker reboot?

They install great, but `pm2 save` doesn't survive the docker reboot so coming back up just loads yolo again 

 

Any ideas?

 
 
 

so the trick was to edit the `pm2Shinobi.yml` 

The plugins were persistent but were just not started as part of Shinobi starting up.

i'm using TensorFlow and Face - my example below:

apps:
  - script   : '/opt/shinobi/camera.js'
    name     : 'Camera-App'
    kill_timeout  : 5000
  - script   : '/opt/shinobi/cron.js'
    name     : 'Cron-App'
    kill_timeout  : 5000
  - script   : '/opt/shinobi/plugins/tensorflow/shinobi-tensorflow.js'
    name     : 'Tensorflow-Plugin'
    kill_timeout  : 5000
  - script   : '/opt/shinobi/plugins/face/shinobi-face.js'
    name     : 'Face-Plugin'
    kill_timeout  : 5000  

 

Edited by Jaburges
codeblock
Link to comment
1 hour ago, Jaburges said:

weird - moeiscool on the discord (lead dev) mentioned that yolo is CPU based - looks like the docker this uses (MiGoller) has Yolo enabled for GPU
I ended up using tensorflow and face

what i reed was that yolo works on cpu and gpu but gpu is more eficient.

Link to comment
On 10/6/2020 at 10:09 PM, Jaburges said:

so the trick was to edit the `pm2Shinobi.yml` 

The plugins were persistent but were just not started as part of Shinobi starting up.

i'm using TensorFlow and Face - my example below:


apps:
  - script   : '/opt/shinobi/camera.js'
    name     : 'Camera-App'
    kill_timeout  : 5000
  - script   : '/opt/shinobi/cron.js'
    name     : 'Cron-App'
    kill_timeout  : 5000
  - script   : '/opt/shinobi/plugins/tensorflow/shinobi-tensorflow.js'
    name     : 'Tensorflow-Plugin'
    kill_timeout  : 5000
  - script   : '/opt/shinobi/plugins/face/shinobi-face.js'
    name     : 'Face-Plugin'
    kill_timeout  : 5000  

 

 

Thanks for this tip, the face-plugin is now loading after restarting the container. Yolo is running fine on the gpu.

 

But how did you the face-plugin running?

 

every time, i upload an image in via super user/facemanager i get this errors

 

4|shinobi-face  | TypeError: backend.batchNormalization is not a function
4|shinobi-face  |     at engine_1.ENGINE.runKernelFunc.x (/opt/shinobi/plugins/face/node_modules/face-api.js/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js:280:27)
4|shinobi-face  |     at /opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3446:55
4|shinobi-face  |     at /opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3285:22
4|shinobi-face  |     at Engine.scopedRun (/opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3295:23)
4|shinobi-face  |     at Engine.tidy (/opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3284:21)
4|shinobi-face  |     at kernelFunc (/opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3446:29)
4|shinobi-face  |     at /opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3458:27
4|shinobi-face  |     at Engine.scopedRun (/opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3295:23)
4|shinobi-face  |     at Engine.runKernelFunc (/opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3456:14)
4|shinobi-face  |     at batchNorm_ (/opt/shinobi/plugins/face/node_modules/face-api.js/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js:279:31)

 

I found some threads online, but nothing really helped me to get the face plugin running.

 

https://stackoverflow.com/questions/51675830/tensorflow-js-typeerror-backend-select-is-not-a-function

https://github.com/tensorflow/tfjs/issues/500

Link to comment
17 hours ago, corgan said:

every time, i upload an image in via super user/facemanager i get this errors

 


4|shinobi-face  | TypeError: backend.batchNormalization is not a function
4|shinobi-face  |     at engine_1.ENGINE.runKernelFunc.x (/opt/shinobi/plugins/face/node_modules/face-api.js/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js:280:27)
4|shinobi-face  |     at /opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3446:55
4|shinobi-face  |     at /opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3285:22
4|shinobi-face  |     at Engine.scopedRun (/opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3295:23)
4|shinobi-face  |     at Engine.tidy (/opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3284:21)
4|shinobi-face  |     at kernelFunc (/opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3446:29)
4|shinobi-face  |     at /opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3458:27
4|shinobi-face  |     at Engine.scopedRun (/opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3295:23)
4|shinobi-face  |     at Engine.runKernelFunc (/opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3456:14)
4|shinobi-face  |     at batchNorm_ (/opt/shinobi/plugins/face/node_modules/face-api.js/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js:279:31)

 

I found some threads online, but nothing really helped me to get the face plugin running.

 

https://stackoverflow.com/questions/51675830/tensorflow-js-typeerror-backend-select-is-not-a-function

https://github.com/tensorflow/tfjs/issues/500

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

have you mapped `/opt/shinobi` to a volume.

 

To get things to work (and conf.json and pm2Shinobi.yml etc to remain persistent) there was a bit of a faff.

1. Start the container without the persistent folder (if you map it first it will fail looking for run.sh)

2. docker cp shinobipro:/opt/shinobi /mnt/user/appdata/shinobi (check the files are in this folder or if they copy to ...shinobi/shinobi note that)

3. now map /mnt/user/appdata/shinobipro:/opt/shinobi

 

I then can recreate the docker without too many issues - I have no idea what the above issue is - but most of my errors cleared out by recreating the container and installing face again

Link to comment
On 10/6/2020 at 10:58 AM, luixmod said:

i have sucessfully mount one cam with ptz with onvif, the controls works and the cam folow person's, the problems:

my docker shinobi is using 40% cpu power :S i dont know why. i only have two cam's using yolo with gpu.

the feed of the cam have delay and the signal to move have a delay too, so the cam is always losing people, i think this problem is the cam and not shinobi.

 

there was been some updates to the docker shinobi gpu? because i install the gpu version and i dont see updates for very long time.

Yeah that could be it, mine doesn't work with ONVIF so I set it up manually to send GET requests to my camera's PTZ endpoints. But Shinobi fails to send any HTTP request with this message

UnhandledPromiseRejectionWarning: ReferenceError: controlURL is not defined

which is not true because everything is set up correctly, as the issue on Gitlab says, this is already fixed on the latest dev version. All we need is to get the image update to Shinobi's latest

Link to comment

Has anyone have issues just trying to get the webUI to load correctly? I installed Shinobi a few weeks ago and everything worked great at first but I've recently had issue where monitors would not load (black screen), or the camera image would stutter or have a lot of artifacts in the image.

 

Like many others here I am running Reolink cameras, and when I have the issue in Shinobi I login to the cameras webUI to see if that has any issues and it never does. Now I regularly get a partially loading Shinobi webUI at times. My server is running deal Xeons with 32GB of DDR4 so I don't think its may hardware not keeping up. I'm currently only running two cameras but I want to add more soon.

 

Just trying to see if this is a me thing or if others are having these issues.

 

 

bad shinobi.JPG

 

Also wondering what the e's are at the bottom of my log file.

 

 

is starting ... \n
2020-10-10T15:39:01: PM2 log: Launching in no daemon mode
2020-10-10T15:39:01: PM2 log: App [Camera-App:0] starting in -fork mode-
2020-10-10T15:39:01: PM2 log: App [Cron-App:1] starting in -fork mode-
2020-10-10T15:39:01: PM2 log: App [Camera-App:0] online
2020-10-10T15:39:01: PM2 log: App [Cron-App:1] online
No "ffbinaries". Continuing.
Run "npm install ffbinaries" to get this static FFmpeg downloader.
No "ffmpeg-static".
Available Hardware Acceleration Methods : vdpau, vaapi
Shinobi : cron.js started
FFmpeg version : 4.2.4
Node.js version : v12.14.1
Shinobi : Web Server Listening on 8080
2020-10-10T15:39:02-04:00 Current Version : ba5743e3801ef240507cf75bdf909916fc51b104

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
This Install of Shinobi is NOT Activated
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2020-10-10T15:39:04-04:00 This Install of Shinobi is NOT Activated
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
https://licenses.shinobi.video/subscribe
2020-10-10T15:39:04-04:00 eduardo@skyartpyro.com : Checking Disk Used..
2020-10-10T15:39:04-04:00 eduardo@skyartpyro.com : /opt/shinobi/videos2/ : 0
2020-10-10T15:39:04-04:00 Starting Monitors... Please Wait...
2020-10-10T15:39:06-04:00 Orphaned Videos Found and Inserted : {"uI00WZV8xd":{"pBG6jtqUFy":0,"e9sJm2JdVE":0}}
2020-10-10T15:39:06-04:00 Shinobi is ready.

e

e

Edited by TrueImpulse
Link to comment
On 10/8/2020 at 9:52 PM, Jaburges said:

have you mapped `/opt/shinobi` to a volume.

 

To get things to work (and conf.json and pm2Shinobi.yml etc to remain persistent) there was a bit of a faff.

1. Start the container without the persistent folder (if you map it first it will fail looking for run.sh)

2. docker cp shinobipro:/opt/shinobi /mnt/user/appdata/shinobi (check the files are in this folder or if they copy to ...shinobi/shinobi note that)

3. now map /mnt/user/appdata/shinobipro:/opt/shinobi

 

I then can recreate the docker without too many issues - I have no idea what the above issue is - but most of my errors cleared out by recreating the container and installing face again

 

thanks for the instruction. I have done this and now have a persistent folder to edit the pm2Shinobi.yml.
Everything looks fine, Yolo is working and running on the gpu

 

MobaXterm_rYUsx8oSSp.png

but i still get theses errors from the face plugin in that moment if the plugin would detect a face.

any ideas?

 

2|Face-Plu |     at /opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3459:27
2|Face-Plu |     at Engine.scopedRun (/opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3296:23)
2|Face-Plu |     at Engine.runKernelFunc (/opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3457:14)
2|Face-Plu |     at batchNorm_ (/opt/shinobi/plugins/face/node_modules/face-api.js/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js:279:31)
2|Face-Plu | TypeError: backend.batchNormalization is not a function
2|Face-Plu |     at engine_1.ENGINE.runKernelFunc.x (/opt/shinobi/plugins/face/node_modules/face-api.js/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js:280:27)
2|Face-Plu |     at /opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3447:55
2|Face-Plu |     at /opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3286:22
2|Face-Plu |     at Engine.scopedRun (/opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3296:23)
2|Face-Plu |     at Engine.tidy (/opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3285:21)
2|Face-Plu |     at kernelFunc (/opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3447:29)
2|Face-Plu |     at /opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3459:27
2|Face-Plu |     at Engine.scopedRun (/opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3296:23)
2|Face-Plu |     at Engine.runKernelFunc (/opt/shinobi/plugins/face/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:3457:14)
2|Face-Plu |     at batchNorm_ (/opt/shinobi/plugins/face/node_modules/face-api.js/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.js:279:31)

 

Link to comment

ok, i fixed the broken face plugin by myself.

 

If someone have trouble with  it, remove the /plugins/face/npm_module Folder (rm -R ) and make shure, your package.json is like the original one

https://github.com/rico360z28/Shinobi/blob/3f536cc1c6c616029f4a8a83c48356cb934979e9/plugins/face/package.json

 

First edit /plugins/face/INSTALL.SH and replace all "@1.7.3" with "@1.7.4".

Second, comment out line 145

#sudo npm audit fix --force

this breaks the dependencies

 

my INSTALL.sh looks like this

 

#!/bin/bash
DIR=`dirname $0`
if [ -x "$(command -v apt)" ]; then
    sudo apt update -y
fi
# Check if Cent OS
if [ -x "$(command -v yum)" ]; then
    sudo yum update -y
fi
INSTALL_WITH_GPU="0"
INSTALL_FOR_ARM64="0"
INSTALL_FOR_ARM="0"
TFJS_SUFFIX=""
echo "----------------------------------------"
echo "-- Installing Face Plugin for Shinobi --"
echo "----------------------------------------"
echo "Are you Installing on an ARM CPU?"
echo "like Jetson Nano or Raspberry Pi Model 3 B+. Default is No."
echo "(y)es or (N)o"
read useArm
if [ "$useArm" = "y" ] || [ "$useArm" = "Y" ] || [ "$useArm" = "YES" ] || [ "$useArm" = "yes" ] || [ "$useArm" = "Yes" ]; then
    INSTALL_FOR_ARM="1"
    echo "Are you Installing on an ARM64 CPU?"
    echo "like Jetson Nano. Default is No (64/32-bit)"
    echo "(y)es or (N)o"
    read useArm64
    if [ "$useArm64" = "y" ] || [ "$useArm64" = "Y" ] || [ "$useArm64" = "YES" ] || [ "$useArm64" = "yes" ] || [ "$useArm64" = "Yes" ]; then
        INSTALL_FOR_ARM64="1"
    fi
fi
if [ -d "/usr/local/cuda" ]; then
    echo "Do you want to install the plugin with CUDA support?"
    echo "Do this if you installed NVIDIA Drivers, CUDA Toolkit, and CuDNN"
    echo "(y)es or (N)o"
    read usecuda
    if [ "$usecuda" = "y" ] || [ "$usecuda" = "Y" ] || [ "$usecuda" = "YES" ] || [ "$usecuda" = "yes" ] || [ "$usecuda" = "Yes" ]; then
        INSTALL_WITH_GPU="1"
        TFJS_SUFFIX="-gpu"
    fi
fi
echo "-----------------------------------"
if [ ! -d "./faces" ]; then
    mkdir faces
fi
if [ ! -d "./weights" ]; then
    mkdir weights
    if [ ! -x "$(command -v wget)" ]; then
        # Check if Ubuntu
        if [ -x "$(command -v apt)" ]; then
            sudo apt install wget -y
        fi
        # Check if Cent OS
        if [ -x "$(command -v yum)" ]; then
            sudo yum install wget -y
        fi
    fi
    cdnUrl="https://cdn.shinobi.video/weights/plugin-face-weights"
    wget -O weights/face_landmark_68_model-shard1 $cdnUrl/face_landmark_68_model-shard1
    wget -O weights/face_landmark_68_model-weights_manifest.json $cdnUrl/face_landmark_68_model-weights_manifest.json
    wget -O weights/face_landmark_68_tiny_model-shard1 $cdnUrl/face_landmark_68_tiny_model-shard1
    wget -O weights/face_landmark_68_tiny_model-weights_manifest.json $cdnUrl/face_landmark_68_tiny_model-weights_manifest.json
    wget -O weights/face_recognition_model-shard1 $cdnUrl/face_recognition_model-shard1
    wget -O weights/face_recognition_model-shard2 $cdnUrl/face_recognition_model-shard2
    wget -O weights/face_recognition_model-weights_manifest.json $cdnUrl/face_recognition_model-weights_manifest.json
    wget -O weights/mtcnn_model-shard1 $cdnUrl/mtcnn_model-shard1
    wget -O weights/mtcnn_model-weights_manifest.json $cdnUrl/mtcnn_model-weights_manifest.json
    wget -O weights/ssd_mobilenetv1_model-shard1 $cdnUrl/ssd_mobilenetv1_model-shard1
    wget -O weights/ssd_mobilenetv1_model-shard2 $cdnUrl/ssd_mobilenetv1_model-shard2
    wget -O weights/ssd_mobilenetv1_model-weights_manifest.json $cdnUrl/ssd_mobilenetv1_model-weights_manifest.json
    wget -O weights/tiny_face_detector_model-shard1 $cdnUrl/tiny_face_detector_model-shard1
    wget -O weights/tiny_face_detector_model-weights_manifest.json $cdnUrl/tiny_face_detector_model-weights_manifest.json
else
    echo "weights 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
if [ ! -e "$DIR/../../libs/customAutoLoad/faceManagerCustomAutoLoadLibrary" ]; then
    echo "Installing Face Manager customAutoLoad Module..."
    sudo cp -r $DIR/faceManagerCustomAutoLoadLibrary $DIR/../../libs/customAutoLoad/faceManagerCustomAutoLoadLibrary
else
    echo "Face Manager customAutoLoad Module already installed..."
fi
tfjsBuildVal="cpu"
if [ "$INSTALL_WITH_GPU" = "1" ]; then
    tfjsBuildVal="gpu"
fi

echo "-----------------------------------"
echo "Adding Random Plugin Key to Main Configuration"
node $DIR/../../tools/modifyConfigurationForPlugin.js face key=$(head -c 64 < /dev/urandom | sha256sum | awk '{print substr($1,1,60)}') tfjsBuild=$tfjsBuildVal
echo "-----------------------------------"
echo "Updating Node Package Manager"
sudo npm install npm -g --unsafe-perm
echo "-----------------------------------"
echo "Getting node-gyp to build C++ modules"
if [ ! -x "$(command -v node-gyp)" ]; then
  # Check if Ubuntu
  if [ -x "$(command -v apt)" ]; then
      sudo apt install node-gyp -y
      sudo apt-get install gcc g++ build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev -y
  fi
  # Check if Cent OS
  if [ -x "$(command -v yum)" ]; then
      sudo yum install node-gyp -y
      sudo yum install gcc-c++ cairo-devel libjpeg-turbo-devel pango-devel giflib-devel -y
  fi
fi
sudo npm install node-gyp -g --unsafe-perm --force
echo "-----------------------------------"
npm uninstall @tensorflow/tfjs-node-gpu --unsafe-perm
npm uninstall @tensorflow/tfjs-node --unsafe-perm
echo "Getting C++ module : @tensorflow/tfjs-node@0.1.21"
echo "https://github.com/tensorflow/tfjs-node"
npm install @tensorflow/tfjs-core@1.7.4 --unsafe-perm --force
npm install @tensorflow/tfjs-converter@1.7.4 --unsafe-perm --force
npm install @tensorflow/tfjs-layers@1.7.4 --unsafe-perm --force
echo "Getting C++ module : face-api.js"
echo "https://github.com/justadudewhohacks/face-api.js"
sudo npm install --unsafe-perm --force
if [ "$INSTALL_WITH_GPU" = "1" ]; then
    echo "GPU version of tjfs : https://github.com/tensorflow/tfjs-node-gpu"
else
    echo "CPU version of tjfs : https://github.com/tensorflow/tfjs-node"
fi
sudo npm install @tensorflow/tfjs-node$TFJS_SUFFIX@1.7.4 --unsafe-perm --force
if [ "$INSTALL_FOR_ARM" = "1" ]; then
    cd node_modules/@tensorflow/tfjs-node$TFJS_SUFFIX
    if [ "$INSTALL_FOR_ARM64" = "1" ]; then
        echo "{
  \"tf-lib\": \"https://cdn.shinobi.video/binaries/libtensorflow-gpu-linux-arm64-1.15.0.tar.gz\"
}" > scripts/custom-binary.json
    else
        echo "{
  \"tf-lib\": \"https://cdn.shinobi.video/binaries/libtensorflow-cpu-linux-arm-1.15.0.tar.gz\"
}" > scripts/custom-binary.json
    fi
    
    cd ../../..
fi
#sudo npm audit fix --force
echo "-----------------------------------"
echo "Start the plugin with pm2 like so :"
echo "pm2 start shinobi-face.js"
echo "-----------------------------------"
echo "Start the plugin without pm2 :"
echo "node shinobi-face.js"


 

 pm2 stop  shinobi-face
 pm2 delete shinobi-face

 cd /opt/shinobi/plugins/face
 rm -R node_modules/

 sh INSTALL.sh

 node shinobi-face.js
 pm2 start shinobi-face.js

 

firefox_EtRBIPN7cQ.pngMobaXterm_9GOVTphmN5.png

  • Like 1
Link to comment

I have narrowed the issue I'm having to be https related. On the local network using the IP and port number of the container to pull up the webUI everything works fine. When I try using the subdomain URL I setup with the reverse proxy config file I made using the templet on page one I get a UI that wont fully load, whether I'm on my local network or not. Not sure how to fix it, was working fine for a while.

 

I recently updated my letsencrypt container to Swag following spaceinvaderone's video he just posted. I had originally just changed the repository name (easy way) when I got the notification from Fix Common Problems about the move to Swag. I then updated to right way after watching the video. No idea if its related but its the only thing I have changed of my server since this issue started.

 

 

1006137315_badshinobi.thumb.JPG.3b7b5b58793a13a60e2a117caf62a207.JPG

Edited by TrueImpulse
Link to comment
6 hours ago, TrueImpulse said:

I have narrowed the issue I'm having to be https related. On the local network using the IP and port number of the container to pull up the webUI everything works fine. When I try using the subdomain URL I setup with the reverse proxy config file I made using the templet on page one I get a UI that wont fully load, whether I'm on my local network or not. Not sure how to fix it, was working fine for a while.

 

I recently updated my letsencrypt container to Swag following spaceinvaderone's video he just posted. I had originally just changed the repository name (easy way) when I got the notification from Fix Common Problems about the move to Swag. I then updated to right way after watching the video. No idea if its related but its the only thing I have changed of my server since this issue started.

 

 

1006137315_badshinobi.thumb.JPG.3b7b5b58793a13a60e2a117caf62a207.JPG

Ok so I ended up grabbing the final proxy.conf file that was available for the letsencrypt docker and replaced the newest Swag one with it. Boom issue solved, Shinobi loads fine via the reverse proxy again. I opened and compared both config files to see what changed. Now I'm no coder but I can understand what most lines are meant to do (I know just enough to be dangerous). After disabling the line "proxy_set_header Upgrade $http_upgrade;" in the Swag proxy.conf file, Shinobi again was working normally though the reverse proxy.

 

Hoping someone much smarter then me can take a look at both these config files and figure out why I was having an issue and if it would effect others. It did not appear to effect any of my other containers running reverse proxy. For now I'm running the final letsencrpyt proxy.conf to be safe.

proxy_letsencrypt.conf proxy_swag.conf

  • Thanks 1
Link to comment
  • 2 weeks later...

I recently started moving from Zoneminder to Shinobi. All credit to Spaceinvader one!

This is coming together well, however I do not get the red line signaling motion in my recordings. 

I found this info on the web but I'm still not getting this figured out.

UI Element > motion meter listed https://shinobi.video/docs/motion

I am assuming that I have turned it off somewhere but just can't seem to find it.

 

Thank you in advanced for any suggestions made.

 

Chas

Link to comment
On 10/11/2020 at 1:54 PM, TrueImpulse said:

Ok so I ended up grabbing the final proxy.conf file that was available for the letsencrypt docker and replaced the newest Swag one with it. Boom issue solved, Shinobi loads fine via the reverse proxy again. I opened and compared both config files to see what changed. Now I'm no coder but I can understand what most lines are meant to do (I know just enough to be dangerous). After disabling the line "proxy_set_header Upgrade $http_upgrade;" in the Swag proxy.conf file, Shinobi again was working normally though the reverse proxy.

 

Hoping someone much smarter then me can take a look at both these config files and figure out why I was having an issue and if it would effect others. It did not appear to effect any of my other containers running reverse proxy. For now I'm running the final letsencrpyt proxy.conf to be safe.

proxy_letsencrypt.conf 1.08 kB · 1 download proxy_swag.conf 1.06 kB · 6 downloads

I had this is exact same problem with my reolink cameras after migrating to SWAG. I disabled the line "proxy_set_header Upgrade $http_upgrade;" as you suggested and my domain now works again. Thanks.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.