In short : Sharing the load for detection requests between plugins, instead of sending to all at one time.
Generally when you connect a plugin, like tensorflow or yolo, you could only send images in certain ways to those plugins. Those methods are as follows.
Plugins being able to run in Cluster Mode adds the following ways to send images to your detection engines.
In gist these methods work as follows :
Using a detection plugin means eat resources on the machine it runs on.
For Example : You may have a server with a lot of load already and decide to move the plugin to another machine but then realize that detection has now met the maximum and you want to do more. Enter Plugins in Cluster Mode.
Now you can setup multiple machines, each running a plugin. Shinobi will disperse image requests between the connected machines automatically.
If one dies, no big deal. Shinobi will just start sending to the other ones as if nothing happened.
Once you revive your plugin server and reconnect: Shinobi will automatically engage it with active processes and their detection requests.
To do this through the web panel :
1. Go to your Super User panel and open the Configuration tab
2. Add the following value in the JSON editing tool.
"detectorPluginsCluster": true,
3. Restart Shinobi.
To do this through command line :
1. Run the following inside the Shinobi folder.
node tools/modifyConfiguration.js addToConfig='{"detectorPluginsCluster":true}'
2. Restart Shinobi.
The idea behind this is to use multiple plugins of the same type so you get a better experience out of your choice. The issue is that a name for a plugin can only be registered once. To get around this just open your plugin's conf.json and edit the plug value.
Example Scenario :
I have 3 machines ready to use tensorflow. Every machine is setup and ready to go, it just needs the plugins enabled and the main application just needs the keys added to allow connection.
Second machine's conf.json would look like this :
{
"plug":"Tensorflow2",
"host":"10.1.103.113",
"tfjsBuild":"gpu",
"port":8080,
"hostPort":8082,
"key":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"mode":"client",
"type":"detector"
}
Third machine's conf.json would look like this :
{
"plug":"Tensorflow3",
"host":"10.1.103.113",
"tfjsBuild":"gpu",
"port":8080,
"hostPort":8082,
"key":"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"mode":"client",
"type":"detector"
}
To do this through the web panel :
1. Go to your Super User panel and open the Configuration tab
2. Add the following value in the JSON editing tool.
"clusterUseBasicFrameCount": false,
3. Restart Shinobi.
To do this through command line :
1. Run the following inside the Shinobi folder.
node tools/modifyConfiguration.js addToConfig='{"clusterUseBasicFrameCount":false}'
2. Restart Shinobi.
The same steps as above for enabling CPU checking are required before enabling checking based on GPU.
To do this through the web panel :
1. Go to your Super User panel and open the Configuration tab
2. Add the following value in the JSON editing tool.
"clusterBasedOnGpu": true,
3. Restart Shinobi.
To do this through command line :
1. Run the following inside the Shinobi folder.
node tools/modifyConfiguration.js addToConfig='{"clusterBasedOnGpu":true}'
2. Restart Shinobi.