Security Barrier Camera Demo

This demo showcases Vehicle and License Plate Detection network followed by the Vehicle Attributes Recognition and License Plate Recognition networks applied on top of the detection results. The corresponding topologies are shipped with the product:

For more details on the topologies, please refer to the descriptions in the deployment_tools/intel_models folder of the OpenVINO™ toolkit installation directory.

Other demo objectives are:

How It Works

On the start-up, the application reads command line parameters and loads the specified networks. The Vehicle and License Plate Detection network is required, the other two are optional.

Upon getting a frame from the OpenCV VideoCapture, the applications performs inference of Vehicles and License Plate Detection network, then performs another two inferences of Vehicle Attributes and License Plate Recognition networks if they were specified in command line, and displays the results.

Running

Running the application with the -h option yields the following usage message:

./security_barrier_camera_demo -h
InferenceEngine:
API version ............ <version>
Build .................. <number>
interactive_vehicle_detection [OPTION]
Options:
-h Print a usage message.
-i "<path1>" "<path2>" Required. Path to video or image files. Default value is "cam" to work with cameras.
-m "<path>" Required. Path to the Vehicle and License Plate Detection model .xml file.
-m_va "<path>" Optional. Path to the Vehicle Attributes model .xml file.
-m_lpr "<path>" Optional. Path to the License Plate Recognition model .xml file.
-l "<absolute_path>" Optional. For CPU custom layers, if any. Absolute path to a shared library with the kernels implementation.
Or
-c "<absolute_path>" Optional. For GPU custom kernels, if any. Absolute path to an .xml file with the kernels description.
-d "<device>" Optional. Specify the target device for Vehicle Detection (CPU, GPU, FPGA, MYRIAD, or HETERO).
-d_va "<device>" Optional. Specify the target device for Vehicle Attributes (CPU, GPU, FPGA, MYRIAD, or HETERO).
-d_lpr "<device>" Optional. Specify the target device for License Plate Recognition (CPU, GPU, FPGA, MYRIAD, or HETERO).
-pc Optional. Enable per-layer performance statistics.
-r Optional. Output inference results as raw values.
-t Optional. Probability threshold for vehicle and license plate detections.
-no_show Optional. Do not show processed video.
-auto_resize Optional. Enable resizable input with support of ROI crop and auto resize.
-nireq Optional. Number of infer request for pipelined mode (default value is 1)
-nc Optional. Number of processed cameras (default value is 1) if the input (-i) is specified as camera.

Running the application with an empty list of options yields the usage message given above and an error message.

To run the demo, you can use public models or a set of pre-trained and optimized models delivered with the package:

For example, to do inference on a GPU with the OpenVINO toolkit pre-trained models, run the following command:

./security_barrier_camera_demo -i <path_to_video>/inputVideo.mp4 -m vehicle-license-plate-detection-barrier-0106.xml -m_va vehicle-attributes-recognition-barrier-0039.xml -m_lpr license-plate-recognition-barrier-0001.xml -d GPU

To do inference for two video inputs using two asynchronous infer request on FPGA with the OpenVINO toolkit pre-trained models, run the following command:

./security_barrier_camera_demo -i <path_to_video>/inputVideo_0.mp4 <path_to_video>/inputVideo_1.mp4 -m vehicle-license-plate-detection-barrier-0106.xml -m_va vehicle-attributes-recognition-barrier-0039.xml -m_lpr license-plate-recognition-barrier-0001.xml -d HETERO:FPGA,CPU -d_va HETERO:FPGA,CPU -d_lpr HETERO:FPGA,CPU -nireq 2

NOTE: Before running the demo with another trained model, make sure the model is converted to the Inference Engine format (*.xml + *.bin) using the Model Optimizer tool.

Optimization Hints for Heterogeneous Scenarios with FPGA

Demo Output

The demo uses OpenCV to display the resulting frame with detections rendered as bounding boxes and text:

example_sample_output.png
Security Camera Demo example output

See Also