On startup, the application reads command line parameters and loads a classification network to the Inference Engine for execution. It might take some time for demo to read all input images. Then the demo performs inference to classify the images and places them on grid.
The demo starts in "Testing mode" with fixed grid size. After calculating the average FPS result, it will switch to normal mode and grid will be readjusted depending on model performance. Bigger grid means higher performance.
When "ground truth" data applied, the color coding for the text, drawn above each image, shows whether the classification was correct: green means correct class prediction, red means wrong.
You can stop the demo by pressing "Esc" or "Q" button. After that, the average metrics values will be printed to the console.
NOTE: By default, Open Model Zoo 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 demo application or reconvert your model using the Model Optimizer tool with the
--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.
The list of models supported by the demo is in
<omz_dir>/demos/classification_demo/cpp/models.lst file. This file can be used as a parameter for Model Downloader and Converter to download and, if necessary, convert models to OpenVINO Inference Engine format (*.xml + *.bin).
An example of using the Model Downloader:
An example of using the Model Converter:
If you want to see classification results, you must use "-gt" and "-labels" flags to specify two .txt files containing lists of classes and labels.
"The ground truth" file is used for matching image file names with correct object classes.
It has the following format:
Class index values must be in range from 0 to 1000. If you want to use "other" class, which is supported only by a small subset of models, specify it with -1 index.
"Labels" file contains the list of human-readable labels, one line for each class.
Please note that you should use
<omz_dir>/data/dataset_classes/imagenet_2015.txt labels file with the following models:
<omz_dir>/data/dataset_classes/imagenet_2012.txt labels file with all other models supported by the demo.
Running the application with the
-h option yields the following usage message:
Running the application with the empty list of options yields an error message.
The number of
InferRequests is specified by -nireq flag. Each
InferRequest acts as a "buffer": it waits in queue before being filled with images and sent for inference, then after the inference completes, it waits in queue until its results are processed. Increasing the number of
InferRequests usually increases performance, because in that case multiple
InferRequests can be processed simultaneously if the device supports parallelization. However, big number of
InferRequests increases latency because each image still needs to wait in queue.
For higher FPS, it is recommended to use -nireq which slightly exceeds -nstreams value summed over all used devices.
For example, use the following command-line command to run the application:
The demo uses OpenCV to display the resulting image grid with classification results presented as a text above images. After the completion, it prints average metrics values to the console.