This sample demonstrates how to execute an inference using ngraph::Function to create a network. The sample uses the LeNet classifications network as an example.
You do not need an XML file to create a network. The API of ngraph::Function allows to create a network on the fly from the source code. The sample uses one-channel
ubyte pictures as an input.
Upon the start-up, the sample reads command-line parameters and creates a network using the ngraph::Function API and passed weights file. Then, the application loads the created network and an image to the Inference Engine core.
When the inference is done, the application outputs inference results to the standard output stream.
NOTE: This sample supports models with FP32 weights only.
lenet.bin weights 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*.
NOTE: By default, Inference Engine samples and demos expect input with BGR channels order. If you trained your model to work with RGB order, you need to manually rearrange the default channels order in the sample or demo application or reconvert your model using the Model Optimizer tool with
--reverse_input_channelsargument specified. For more information about the argument, refer to When to Reverse Input Channels section of Converting a Model Using General Conversion Parameters.
Running the application with the
-h option yields the following usage message:
For example, to do inference of an UByte image on a GPU run the following command:
By default, the application outputs top-10 inference results for each inference request.