GstInference - Supported backends - NCSDK

From RidgeRun Developer Connection
Jump to: navigation, search



Previous: Supported backends Index Next: Example pipelines




The NCSDK Intel® Movidius™ Neural Compute SDK (Intel® Movidius™ NCSDK) enables deployment of deep neural networks on compatible devices such as the Intel® Movidius™ Neural Compute Stick. The NCSDK includes a set of software tools to compile, profile, and validate DNNs (Deep Neural Networks) as well as APIs on C/C++ and Python for application development.

The NCSDK has two general usages:

  • Profiling, tuning, and compiling a DNN models.
  • Prototyping user applications, that run accelerated with a neural compute device hardware, using the NCAPI.

Installation

You can install the NCSDK on a system running Linux directly, downloading a Docker container, on a virtual machine or using a Python virtual environment. Al the possible installation paths are documented on the official installation guide.

Tools

mvNCCheck

Checks the validity of a Caffe or TensorFlow model on a neural compute device. The check is done by running an inference on both the device and in software and then comparing the results to determine a if the network passes or fails. This tool works best with image classification networks. You can check all the available options on the official documentation.

For example lets test the googlenet caffe model downloaded by the ncappzoo repo:

mvNCCheck -w bvlc_googlenet.caffemodel -i ../../data/images/nps_electric_guitar.png -s 12 -id 546  deploy.prototxt -S 255 -M 110
  • -w indicates the weights file
  • -i the input image
  • -s the number of shaves
  • -id the expected label id for the input image (you can find the id for any imagenet model here)
  • -S is the scaling sice
  • -M is the substracted mean after scaling

Most of these parameters are available from the model documentation. The command produces the following result:

lob generated
USB: Transferring Data...
USB: Myriad Execution Finished
USB: Myriad Connection Closing.
USB: Myriad Connection Closed.
Result:  (1000,)
1) 546 0.99609
2) 402 0.0038853
3) 420 8.9228e-05
4) 327 0.0
5) 339 0.0
Expected:  (1000,)
1) 546 0.99609
2) 402 0.0039177
3) 420 9.0837e-05
4) 889 1.2875e-05
5) 486 5.3644e-06
------------------------------------------------------------
 Obtained values 
------------------------------------------------------------
 Obtained Min Pixel Accuracy: 0.0032552085031056777% (max allowed=2%), Pass
 Obtained Average Pixel Accuracy: 7.264380030846951e-06% (max allowed=1%), Pass
 Obtained Percentage of wrong values: 0.0% (max allowed=0%), Pass
 Obtained Pixel-wise L2 error: 0.00011369892179413199% (max allowed=1%), Pass
 Obtained Global Sum Difference: 7.236003875732422e-05
------------------------------------------------------------

mvNCCompile

Compiles a network and weights files from Caffe or TensorFlow models into a graph file that is compatible with the NCAPI.

For example, giving a caffe model (bvlc_googlenet.caffemodel) and a network description (deploy.prototxt):

mvNCCompile -w bvlc_googlenet.caffemodel -s 12 deploy.prototxt

This command will output the graph and output_expected.npy files, that will be used later on the API

mvNCProfile

API

Previous: Supported backends Index Next: Example pipelines