This sample demonstrates how to execute an inference of object detection networks like SSD-VGG using Asynchronous Inference Request API and input reshape feature.
Object Detection SSD C sample application demonstrates how to use the following Inference Engine C API in applications:
|Asynchronous Infer||ie_infer_request_infer_async||Do Asynchronous inference|
|Inference Engine Version||ie_c_api_version||Get Inference Engine API version|
|Available Devices||ie_core_get_versions||Get version information of the devices for inference|
|Custom Extension Kernels||ie_core_add_extension||Load extension library and config to the device|
|Network Operations||ie_network_get_inputs_number ie_network_get_input_shapes ie_network_get_output_dims||Managing of network|
|Blob Operations||ie_blob_get_buffer||Work with memory container for storing inputs, outputs of the network, weights and biases of the layers|
|Input Reshape||ie_network_reshape||Set the batch size equal to the number of input images|
Basic Inference Engine API is covered by Hello Classification C sample.
|Model Format||Inference Engine Intermediate Representation (.xml + .bin), ONNX (.onnx)|
|Validated images||The sample uses OpenCV* to read input image (.bmp, .png, .jpg)|
|Other language realization||C++, Python|
Upon the start-up the sample application reads command line parameters, loads specified network and image(s) to the Inference Engine plugin. Then, the sample creates an asynchronous inference request object. When inference is done, the application creates output image(s) and output data to the 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.
To build the sample, please use instructions available at Build the Sample Applications section in Inference Engine Samples guide.
To run the sample, you need specify a model and image:
Running the application with the
-h option yields the following usage message:
- 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.
- Before running the sample with a trained model, make sure the model is converted to the Inference Engine format (*.xml + *.bin) using the Model Optimizer tool.
- The sample accepts models in ONNX format (.onnx) that do not require preprocessing.
person-detection-retail-0013model does not need to be converted, because it is already in necessary format, so you can skip this step. If you want to use a other model that is not in the Inference Engine IR or ONNX format, you can convert it using the model converter script:
The application outputs several images (
out_1.bmp, ... ) with detected objects enclosed in rectangles. It outputs the list of classes of the detected objects along with the respective confidence values and the coordinates of the rectangles to the standard output stream.