There are only few OSes officially fully supported by Movidius SDK.
However, Movidius SDK is made of two parts:
The NCSDK tools: these tools allows to translate (and validate the translation) machine learning models to Movidius format so they can be run by the Movidius key. This part is the most complex and not (not yet) supported on Mac OS.
Note this part does not need a Movidius key to be actually present.
The NCS API: this part manages communication with Movidius key and allows to upload a model in Movidius format to the Movidius key, upload some inference data and download the inference result. Technically, this part is 'only' a C code using standard libusb to handle a USB conversation so it can run on any OS having libusb and a C compiler.!
Install prerequisites
Let's get a python install which will not collide with mac's one
libmvnc.so uses libusb.so to send/receive data through usb
brew install libusb
ncsdk makefile (me too by the way) does not like Mac's sed. Let's get a more standard one by installing gsed
brew install gnu-sed
ncsdk samples need to download graphs and therefore need to use wget
brew install wget
Install tensorflow in our python env
pip install tensorflow
We will need opencv
brew install opencv
we will need a C/C++ compiler. Install Xcode (it's free now) and be sure to install and activate command line tools
xcode-select --install
Install & Trick Movidius SDK
Grab standard ncsdk
cd $HOME
mkdir Movidius
cd $HOME/Movidius
git clone https://github.com/movidius/ncsdk.git
Trick the Makefile & generate the only mandatory component on Mac OS: libmvnc.so
cd ncsdk
# adapt compilation env to Mac and use gsed instead of sed
find . -name Makefile -exec sed -i -- 's/include\/libusb/local\/include\/libusb/g; s/sed/gsed/g' {} \;
# fix an issue with execution rights
find . -name run.py -exec chmod +x {} \;
cd api/src
make all
sudo make basicinstall pythoninstall
Now, you should already be able to load and execute a compiled graph in your Movidius key !!! Let's make the ncdsk check it
Run some Movidius SDK's samples
run tensorflow samples
Caffe examples are not working for an unknown (yet) reason. But tensorflow models are OK
cd $HOME/Movidius/ncsdk/examples/tensorflow
make compile
... plenty of messages and warnings
make run
Strangely, make check (mvncCheck) and make profile (mvncProfile) are not (not yet) OK but basic tensorflow models can be transmogrified to Movidius format, sent to Movidius key and run !
2. run other app example: hello cpp app
This is the Movidius's Hello World
cd $HOME/Movidius/ncsdk/examples/apps/hello_ncs_cpp
make run
Hello NCS! Device opened normally.
Goodbye NCS! Device Closed normally.
run other app example: hello python app
cd $HOME/Movidius/ncsdk/examples/apps/hello_ncs_py
make run
making run
python3 hello_ncs.py;
Hello NCS! Device opened normally.
Goodbye NCS! Device closed normally.
NCS device working.
Playing with Movidius App Zoo
Basic usage of Movidius key has been validated. Let's see what is happening with more serious models and samples...
Install and trick the App Zoo
Again, transmogrifying a model to Movidius format is not yet working on Mac, specially a caffe model. As most examples in app zoo are caffe models, we have to make a smart move : generate all Movidius models where it is possible and use them on Mac
Get the hand on your best Ubuntu box (a vm, a native install, whatever) and do the official installation of Movidius sdk
When Movidius sdk is fully installed and working, install the ncappzoo
请发表评论