Shinobi/plugins/tensorflow
Moe Alam 505c098471 tensorflow : set original installer for only desktop/server installs
- jetson nano now has its own install script for this plugin, INSTALL-jetson.sh
- Raspberry Pi support will be reconsidered in the near future but not a priority at this time.
2021-01-12 11:55:15 -08:00
..
.env Update plugin TensorFlow GPU Install 2020-04-26 11:57:47 -07:00
.gitignore ignore .env for tensorflow plugin and create during install 2020-05-11 19:36:08 -07:00
INSTALL-2-3-0.sh tensorflow : add installer specific to Jetson Nano and Xavier 2021-01-12 11:41:11 -08:00
INSTALL-jetson.sh tensorflow : add installer specific to Jetson Nano and Xavier 2021-01-12 11:41:11 -08:00
INSTALL.sh tensorflow : set original installer for only desktop/server installs 2021-01-12 11:55:15 -08:00
ObjectDetectors.js Added modelUrl support to tensorflow plugin. 2020-07-06 17:56:51 -04:00
README.md - Make Tensorflow's INSTALL.sh optionally non-interactive 2020-10-06 04:44:34 +00:00
conf.sample.json Allow choosing CPU or GPU for TensorFlow plugin 2020-01-20 08:30:31 -08:00
package-2-3-0.json Add basic tensorflow plugin installer for Jetson Nano using 2.3.0 tfjs 2020-12-22 11:03:20 -08:00
package.json update tensorflow plugin original installer for 2.7.0 2020-12-27 21:08:27 -08:00
shinobi-tensorflow.js shinobi-tensorflow.js : add Websocket Disconnect when checkStartTime fails 2020-11-19 16:26:23 -08:00
test.js tensorflow plugin : update test images used 2020-12-22 12:32:56 -08:00

README.md

TensorFlow.js

Ubuntu and CentOS only

Go to the Shinobi directory. /home/Shinobi is the default directory.

cd /home/Shinobi/plugins/tensorflow

Copy the config file.

  • To run the install script interactively:
sh INSTALL.sh
  • To run the install script non-interactively:
sh INSTALL.sh

WITH the appropriate flags

Flag Purpose
--jetson Install for Jetson Nano
--arm Install for ARM Processors (like Raspberry Pi Model 3 B+)
--gpu Install for GPU support
--dont-create-key Don't generate random plugin key

Start the plugin.

pm2 start shinobi-tensorflow.js

Doing this will reveal options in the monitor configuration. Shinobi does not need to be restarted when a plugin is initiated or stopped.

Run the plugin as a Host

The main app (Shinobi) will be the client and the plugin will be the host. The purpose of allowing this method is so that you can use one plugin for multiple Shinobi instances. Allowing you to easily manage connections without starting multiple processes.

Edit your plugins configuration file. Set the hostPort to be different than the listening port for camera.js.

nano conf.json

Here is a sample of a Host configuration for the plugin.

  • plug is the name of the plugin corresponding in the main configuration file.
  • https choose if you want to use SSL or not. Default is false.
  • hostPort can be any available port number. Don't make this the same port number as Shinobi. Default is 8082.
  • type tells the main application (Shinobi) what kind of plugin it is. In this case it is a detector.
{
  "plug":"Tensorflow",
  "hostPort":8082,
  "key":"Tensorflow123123",
  "mode":"host",
  "type":"detector"
}

Now modify the main configuration file located in the main directory of Shinobi.

nano conf.json

Add the plugins array if you don't already have it. Add the following object inside the array.

  "plugins":[
      {
          "id" : "Tensorflow",
          "https" : false,
          "host" : "localhost",
          "port" : 8082,
          "key" : "Tensorflow123123",
          "mode" : "host",
          "type" : "detector"
      }
  ],