<jupyter_start><jupyter_text>Intel Neural Compute Stick - MovidiusIntel's Movidius™ Myriad™ 2 VPU is an industry-defining always-on vision processor, and second generation VPU from Movidius™, an Intel® company. Myriad 2 can be found in millions of devices on the market today and continues to be utilized for some of the most ambitious AI, vision and imaging applications where both performance and low power consumption are ![](resources/myriad_vpu.png)Standing at the intersection of low-power and high performance, the Myriad 2 family of processors are transforming the capabilities of devices. Myriad 2 gives device makers industry-proven performance on AI, imaging and computer vision tasks, all at an unbeatable performance/price proposition.The Intel® Movidius™ Neural Compute Stick (Intel® Movidius™ NCS) enables rapid prototyping of deep neural networks (DNNs) with the Intel® Movidius™ Neural Compute SDK (NCSDK).![](resources/ncs.jpg)Images from: https://movidius.github.io/ncsdk/  The Myriad VPU includes 4Gbits of LPDDR3 DRAM, imaging and vision accelerators, and an array of 12 VLIW vector processors called SHAVE processors. These processors are used to accelerate neural networks by running parts of the neural networks in parallel.The NCS is connected to a host machine using the USB interface on the VPU. The USB3 interface can be used both in Super Speed (5 Gbps) or High Speed (480 Mbps) modes.![](resources/ncs_architecture.jpg)The VPU also has a SPARC microprocessor core that runs custom firmware. When the NCS is first plugged in, there is no firmware loaded onto it. The VPU boots from the internal ROM and connects to the host machine as a USB 2.0 device. Applications executing on the host machine communicate to the VPU SOC using the Neural Compute API (NCAPI). When the NCAPI initializes and opens a device, the firmware from the Neural Compute SDK (NCSDK) is loaded onto the NCS. At this time, the NCS resets and reconnects to the host machine as either a USB 2.0 or USB 3.0 device (depending on the host type). It is now ready to accept the neural network graph files and instructions to execute inferences.A graph file is loaded into the DRAM attached to the VPU via the NCAPI. A LEON processor coordinates receiving the graph file and images for inference via the USB connection. It also parses the graph file and schedules kernels to the SHAVE neural compute accelerator engines. In addition, the LEON processor also takes care of monitoring die temperature and throttling processing on high temperature alerts. The output of the neural network and associated statistics are sent back to the host machine via the USB connection and are received by the host application via the NCAPI.  Intel Neural Compute Stick SDK The [Intel® Movidius™ Neural Compute SDK](https://github.com/movidius/ncsdk) provides tools for profiling, tuning, and compiling a deep neural network (DNN) model on a development computer (host system).In order to develop applications using Movidius NCS Stick you should install tools and SDK as following.In order to install it on Ubuntu 16.04, clone the sdk from github repo:Check following url for installation instructions: https://github.com/movidius/ncsdk NCSDK Installation Instructions```shellgit clone https://github.com/movidius/ncsdk.git ```or get version 2 from ncsdk2 branch. v2 is not back compatible.```shellgit clone -b ncsdk2 https://github.com/movidius/ncsdk.gitcd ncsdk && make install```After installation, you can get a set of examples from SDK App Zoo:```shellgit clone https://github.com/movidius/ncappzoo.git```or NCSDK v2```shellgit clone -b ncsdk2 https://github.com/movidius/ncappzoo.git```You will see set of applications under `ncappzoo/app/` folder. Navigate to any of application folder, and run `make`, which downloads required models and video resources to run the application as shown below.```shellcd ncappzoo/apps/video_objectsmake python3 video_objects.py```  Start from Scratch with NCSDKLike all dedicated hardwares, Myriad VPU should get neural net's with its own format. Therefore NCSDK application `mvNCCompile` is provided with SDK to convert existing Caffe or Tensorflow models to required graph file with certain set of parameters to load them on Movidius.`mvNCCompile is a command line tool that compiles network and weights files for Caffe or TensorFlow* models into an Intel® Movidius™ graph file format that is compatible with the Intel® Movidius™ Neural Compute SDK (Intel® Movidius™ NCSDK) and Neural Compute API (NCAPI).`Please see following documentation for arguments details: https://movidius.github.io/ncsdk/tools/compile.htmlRequired input is neural net file: `.prototxt` and `.caffemodel` for Caffe models`.pb` or `.meta` for Tensorflow models`-w` defines the weights, .caffemodel for Caffe Framework Model`-s` The number of available SHAVEs depends on your neural compute device. The device runtime code may use fewer SHAVEs for some layers where measurements have typically shown no inference performance degradation (and consequently show a power benefit) from using fewer SHAVEs.`-is` Specify input dimensions for networks that do not have dimension constraints on the input layer.Caffe Model Conversion Sample```shellmvNCCompile dnn_models/MobileNetSSD_deploy.prototxt -w dnn_models/MobileNetSSD_deploy.caffemodel -s 12 -is 300 300 -o MobileNetSSD.graph```Tensorflow Sample (Not working example, fix it later)```shellmvNCCompile inception-v1.meta -s 12 -in=input  -is 300 300 -o frozen.graph``` mvNCCheck`mvNCCheck` is a command line tool that checks the validity of a Caffe or TensorFlow* neural network on a neural compute device.The check is done by running an inference on both the device and in software on the host computer using the supplied network and appropriate framework libraries. The results for both inferences are compared to determine a if the network passes or fails. The top 5 inference results are provided as output. This tool works best with image classification networks. mvNCProfile`mvNCProfile` is a command line tool that compiles a network for use with the Intel® Movidius™ Neural Compute SDK (Intel® Movidius™ NCSDK), runs the network on a connected neural compute device, and outputs text and HTML profile reports.The profiling data contains layer-by-layer statistics about the performance of the network. This is helpful in determining how much time is spent on each layer to narrow down potential changes to the network to improve the total inference time. NCSDK API A quick overview of NC SDK Overview: https://movidius.github.io/ncsdk/ncapi/ncapi2/c_api/readme.html<jupyter_code>## Object Detection with  Movidius using Python API

Below sample uses converted Caffe Model and loads it to Movidius for object detection.

For more comprehensive example refer to [RealTimeObjectDetection.py](RealTimeObjectDetection.py) code sample.<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.0509701708659137, 'fraction_numerical': 0.007095279467130032, 'mean_word_length': 5.1559714795008915, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 9, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '635593', 'license': 'MIT', 'n_tokens_mistral': 1854, 'n_tokens_neox': 1688, 'n_words': 962, 'path': 'Movidius Overview.ipynb', 'repo_name': 'odundar/computer-vision', 'size': '6906'}