Skip to content

AI Host Installation

wb666greene edited this page May 29, 2018 · 7 revisions

AI Host Software Installation

  1. Setup a Raspberry Pi3 (B+ preferred) with a Movidius Neural Compute Stick following these instructions.
  • But here is the gist of what needs to be done based on my notes:

  • // Modvius Neuro Compute Stick setup. On fresh Pi Raspbian Stretch install as root do:

  • apt-get update || apt-get upgrade

  • apt-get install libusb-1.0-0-dev libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler libatlas-base-dev git automake byacc lsb-release cmake libgflags-dev libgoogle-glog-dev liblmdb-dev swig3.0 graphviz libxslt-dev libxml2-dev gfortran

  • // then install python3 stuff:

  • apt-get install python3-dev python-pip python3-pip python3-setuptools python3-markdown python3-pillow python3-yaml python3-pygraphviz python3-h5py python3-nose python3-lxml python3-matplotlib python3-numpy python3-protobuf python3-dateutil python3-skimage python3-scipy python3-six python3-networkx python-opencv

  • // then install python modules:

  • pip install imutils

  • pip install "picamera[array]"

  • pip install paho-mqtt

  • // exit root and download and install NCS SDK:

  • mkdir workspace

  • cd workspace

  • git clone https://github.com/movidius/ncsdk

  • git clone https://github.com/movidius/ncappzoo

  • cd ~/workspace/ncsdk/api/src

  • make

  • sudo make install

  • // test it:

  • // make sure the NCS sick is plugged it!

  • cd ~/workspace/ncappzoo/apps/hello_ncs_py

  • make run

  • // should return:

  • Hello NCS! Device opened normally

  • Goodbye NCS! Device closed normally.

  • NCS device working.

  • (Sorry I haven't got the hang of github formatting)

// mosquitto MQTT broker and commandline tools (save typing by installing the -dev of a library // which also gets the library and saves you needing to add the -dev package later) sudo apt-get install mosquitto-dev mosquitto-clients // // test the installation with these commands: pi@noirOne:~ $ mosquitto_sub -h localhost -t test & [1] 1114 pi@noirOne:~ $ mosquitto_pub -h localhost -t test -m "testing 1 2 3 ..." testing 1 2 3 ... pi@noirOne:~ $ fg %1 mosquitto_sub -h localhost -t test ^C pi@noirOne:~ $

(I can't make heads or tails of what is going to become of my text between the Write tab and the Preview tab. I'm done for now!)

  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. Start node-red and configure to run on startup on the AI Host. A good starting point for node-red is: node-red cookbook

  4. Install node-red-contrib-ftp-server This can be done from node-red running in your browser using the "Manage Pallet" menu selection or with npm as described here: npmjs.

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

  6. Connect to the node-red web server on the AI host from any Chrom, 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 past 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).

  7. 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.

Clone this wiki locally