This sample demonstrates how to execute an inference using nGraph function feature to create a network that uses weights from LeNet classification network, which is known to work well on digit classification tasks. So you don't need an XML file, the model will be created from the source code on the fly.
In addition to regular grayscale images with a digit, the sample also supports single-channel
ubyte images as an input.
The following Inference Engine Python API is used in the application:
|Network Operations||IENetwork, IENetwork.batch_size||Managing of network|
|nGraph Functions||ngraph.impl.Function, ngraph.parameter, ngraph.constant, ngraph.convolution, ngraph.add, ngraph.max_pool, ngraph.reshape, ngraph.matmul, ngraph.relu, ngraph.softmax, ngraph.result, ngraph.impl.Function.to_capsule||Description of a network using nGraph Python API|
Basic Inference Engine API is covered by Hello Classification Python* Sample.
|Model Format||Network weights file (*.bin)|
|Validated images||The sample uses OpenCV* to read input grayscale image (*.bmp, *.png) or single-channel |
|Other language realization||C++|
At startup, the sample application reads command-line parameters, prepares input data, creates a network using nGraph function feature and passed weights file, loads the network and image(s) to the Inference Engine plugin, performs synchronous inference, and processes output data, logging each step in a standard output stream.
You can see the explicit description of each sample step at Integration Steps section of "Integrate the Inference Engine with Your Application" guide.
Run the application with the
-h option to see the usage message:
To run the sample, you need specify a model weights and image:
- This sample supports models with FP32 weights only.
lenet.binweights file was generated by the Model Optimizer tool from the public LeNet model with the
--input_shape [64,1,28,28]parameter specified.
- The original model is available in the Caffe* repository on GitHub*.
- The white over black images will be automatically inverted in color for a better predictions.
For example, you can do inference of
3.png using the pre-trained model on a
The sample application logs each step in a standard output stream and outputs top-10 inference results.
|Deprecation Begins||June 1, 2020|
|Removal Date||December 1, 2020|
Starting with the OpenVINO™ toolkit 2020.2 release, all of the features previously available through nGraph have been merged into the OpenVINO™ toolkit. As a result, all the features previously available through ONNX RT Execution Provider for nGraph have been merged with ONNX RT Execution Provider for OpenVINO™ toolkit.
Therefore, ONNX RT Execution Provider for nGraph will be deprecated starting June 1, 2020 and will be completely removed on December 1, 2020. Users are recommended to migrate to the ONNX RT Execution Provider for OpenVINO™ toolkit as the unified solution for all AI inferencing on Intel® hardware.