Skip to content

AI Host Installation

wb666greene edited this page May 30, 2018 · 7 revisions

The Demo System:

Demo System

Cellphone photo of system running on Pi3 AI Host:

Running Demo

The 300x300 window in the top left of the screen is the last image sent to the AI for processing. It is a resized version of the most recent snapshot from MotioneyeOS via ftp.

The window below it is the MotioneyeOS live monitor shown in a Browser window. The large window top right is the last positive detection from the AI.

If you look carefully you will see the live image is not image in small window, this is because only "motion" images are sent to the AI for processing and MotioneyeOS has a very good video motion detection system, especially when used indoors. This greatly reduces the load on the AI subsystem letting one Movidius handle multiple cameras.

I've also run the demo system with two MotioneyeOS cameras, and my "real" system handles snapshots from nine FLIR/Lorex cameras. One "trick" is that the node-red ftp server flow and MQTT transfer of the images to the AI python script automatically interleaves and buffers the frames to be analyzed.

AI Host Software Installation

Sorry, below this point is awful and probably useless at the moment, I'm struggling with the gitub formatting.

  1. Setup a Raspberry Pi3 (B+ preferred) with a Movidius Neural Compute Stick following these instructions.
  • Here is the gist of what needs to be done based on my notes: Setup Movidius
  1. Download the sample code from this real-time tutorial to get the complied Movidius graph. (It'd be nice if I could get permission to redistribute this graph file here to make things simpler)

  2. Download my AI_detection.py script AI_detect.py and place it in the same sub-directory as the Movidius sample script and graph directory.

  3. From here on, its assumed you've booted the AI_Host GUI and are running on the Pi

    Download and install my ftpToMovidius.formatted.json from here. Open it in a text editor and copy the entire contents to the clipboard.

  4. Connect to the node-red web server on the AI host from any Chrome, Chromium, or Firefox browser, use port 1880, i.e.connect: http://AI_HOST_IP:1880 Once the page loads use the drop-down menu and choose Import->Clipboard and paste in the json file from the clipboard into the dialog that pops up and press one of the import buttons. Then you should see the graph of the flow (which is the visual representation of the node-red nodejs program).

  5. Double click the node-red-contrib-ftp-server node and enter the username and password you've changed your Raspbian to after installation. I set the ftp port to 31415. Press the "Deploy" button to start the ftp server.

  6. You should now be ready to start the python script after changing to its directory (with the Movidius graph file):

python AI_detection.py -d2

Once your DVR or MotioneyeOS starts ftping images you should see the small window update with the 300x300 images sent to the Movidius and the larger window update when a person is detected on the frame.

Clone this wiki locally