Shinobi/plugins/tensorflow-coral
Moe 41d49358fd Change console.logs to debugLog for coral plugin 2021-05-31 07:44:01 -07:00
..
.gitignore adding coral tensorflow plugin 2020-09-19 12:36:58 +02:00
INSTALL.sh Mitch Coral Plugin Update 2021-01-28 15:04:07 +00:00
README.md Mitch Coral Plugin Update 2021-01-28 15:04:07 +00:00
conf.sample.json adding coral tensorflow plugin 2020-09-19 12:36:58 +02:00
detect_image.py Clean up detect_image, add comments. Remove unnecessary code. 2021-02-07 19:57:42 +00:00
package.json rename shinobi-tensorflow (for coral) to shinobi-tensorflow-coral 2020-12-02 13:23:27 -08:00
shinobi-tensorflow-coral.js Change console.logs to debugLog for coral plugin 2021-05-31 07:44:01 -07:00
shinobi-tensorflow.js rename shinobi-tensorflow (for coral) to shinobi-tensorflow-coral 2020-12-02 13:23:27 -08:00

README.md

TensorFlowCoral.js

Follow the Official Coral PCI install instructions carefully. https://coral.ai/docs/m2/get-started/#2-install-the-pcie-driver-and-edge-tpu-runtime

Install

Run INSTALL.sh

pm2 start shinobi-tensorflow-coral.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"
      }
  ],