Get Started with the IEI Tank* AIoT Dev Kit and Intel® System Studio

Published: 10/01/2019  

Last Updated: 10/01/2019

Introduction

Follow these steps to connect your IEI Tank* AIoT Dev Kit to Intel® System Studio and begin working with your development kit. This guide assumes you have already set up and powered your system according to the guide included in the box.

tank image

You'll walk through the following basic steps:

Run and Modify an Intel® Distribution of OpenVINO™ toolkit Application


Modify a vehicle detection project to run on an IEI* Mustang-V100-MX8 AI acceleration card


Run and Modify an Intel® Distribution of OpenVINO toolkit

In this section, you'll run a vehicle detection application. By default, this sample application runs on the CPU and detects vehicles in a static image, using the Intel® Distribution for OpenVINO™ toolkit. You'll modify the project to run on a sample video instead, and offload the processing to your GPU.

Intel® technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. Check with your system manufacturer or retailer.

Before you begin

These steps were tested with the following configuration:

  • IEI Tank* AIoT Dev Kit with Intel® System Studio 2019 Update 4
  • Version 2019 R2 of the Intel® Distribution of OpenVINO™ toolkit

The models used in this example are pre-trained models included with the Intel® Distribution of OpenVINO™ toolkit. For additional information about each of these models, refer to the model descriptions, located by default in the appropriate directories in:

/opt/intel/openvino/deployment_tools/intel_models/

Run Intel® System Studio

Launch the application using the desktop ISS icon. The environment variable is preset for use.

Tip: Check that the environment variables are set in Intel® System Studio. If not, run the following command to set environment variables: sudo cp /opt/intel/openvino/bin/setupvars.sh /opt/intel/system_studio_2019/env.d/linux/

  1. Click the icon for Intel® System Studio to open.
  2. Keep the default workspace and click Launch to launch Intel® System Studio.

Run a sample project on the CPU

Your sample project has already been included in Intel® System Studio for you. Follow the steps below to run it for the first time.

  1. In the Project Explorer, expand the demos folder. Expand the Binaries folder and select the security_barrier_camera_demo folder.
  2. From the Run drop-down list in the toolbar, select Run Configurations.
  3. The Run Configurations dialog box opens.
  4. On the left under C/C++ Application, select security_barrier_camera_demo.
  5. Click the Arguments tab.
  6. Next, you'll change the existing program arguments to run the project on the accelerator card. This information and more details about the arguments you can supply to the sample can be found in the README.md file in the security barrier camera demo source files.
  7. Copy the following argument string:
    -t 0 -d CPU -i "/opt/intel/openvino/deployment_tools/demo/car_1.bmp"  -m "${MODEL_DIR}/Security/object_detection/barrier/0106/dldt/FP32/vehicle-license-plate-detection-barrier-0106.xml" -m_va "${MODEL_DIR}/Security/object_attributes/vehicle/resnet10_update_1/dldt/FP32/vehicle-attributes-recognition-barrier-0039.xml" -m_lpr "${MODEL_DIR}/Security/optical_character_recognition/license_plate/dldt/FP32/license-plate-recognition-barrier-0001.xml"
  8. Paste the string into Program arguments field.
  9. Once finished, click Run.
  10. The sample runs on an image, highlighting the vehicles it detects in bounding boxes. You'll see labels displayed next to the cars it detects, such as "black car".

    In the text displayed over the image, you can see data about the sample. Note the fps value, which you can use to estimate performance; a higher fps value corresponds to better performance.

The image used in the example is a simple .bmp image:

Format .bmp
Dimension 749x637 pixels
Size 1.36 MB

Congratulations, you've successfully run the sample! Now that you're finished, click the red X icon at the top of the pop-up window to close it.

After you close the window, you can check the Console for averaged statistics about the sample you just ran, including the fps data.

View CPU utilization

You can view CPU utilization on your device, then compare the performance change when you move processing to the GPU or a vision accelerator.

  1. Click the Ubuntu* icon in your taskbar. From the search bar, search for and open the System Monitor application.
  2. Click the Resources tab to bring up the CPU History chart. You can see how the CPU utilization changes when you run the sample on the CPU, as described below.

Afterwards, keep the application open so you can compare the utilization numbers when you offload application processing to the GPU or an accelerator.

Modify your program to run on a video

Next, you'll modify the project to run on a video instead of an image.

  1. Make sure you have a copy of the sample video in your Downloads folder: ${HOME}/Downloads/car-detection.mp4

    If you don't have the sample video, download it from: Car Detection

  2. Back in the Project Explorer, make sure you have the security_barrier_camera_demo folder selected.
  3. From the Run drop-down list in the toolbar, select Run Configurations.
  4. Under C/C++ Application, select the security_barrier_camera_demo run configuration.
  5. Click the Arguments tab.
    Next, you'll change the existing program arguments to use a video file instead of a static image, and to define the confidence threshold level for the Intel® object detection model being used. You'll use a high value of 0 to avoid getting false positives when your application is detecting the cars in the video.

    This information and more details about the arguments you can supply to the sample can be found in the README.md file in the security_barrier_camera_demo source files.

  6. Copy the following argument string.
    -t 0 -d CPU -i "/home/ieisw/Downloads/car-detection.mp4" -m "${MODEL_DIR}/Security/object_detection/barrier/0106/dldt/FP16/vehicle-license-plate-detection-barrier-0106.xml" -m_va "${MODEL_DIR}/Security/object_attributes/vehicle/resnet10_update_1/dldt/FP16/vehicle-attributes-recognition-barrier-0039.xml" -m_lpr "${MODEL_DIR}/Security/optical_character_recognition/license_plate/dldt/FP16/license-plate-recognition-barrier-0001.xml"
  7. Paste the string into the Program arguments field.
  8. Once finished, click Run.

    Your project runs. The results appear in the Console and in a separate video window. In the video, you'll see several cars driving through a parking lot. The application will highlight the vehicles it detects in bounding boxes and display a label next to each car ("white car", "red car", etc.).

    In the text displayed over the video, you can see live data about the sample. Note the fps value, which you can use to estimate performance. A higher fps value corresponds to better performance.

    Intel® technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. Check with your system manufacturer or retailer

    The video used in the example is an .mp4 file:

    Format .mp4
    Duration 31 seconds†
    Dimensions 768x432 pixels
    Size 2.8 MB

    †played at accelerated speed for 6-7 seconds

    If you have the System Monitor open, you can see the CPU utilization spike as the project runs. Notice how the CPU utilization for all cores rises while the sample runs.

  9. After the video closes automatically, you can check the Console for averaged statistics about the sample you just ran, including the fps data. IMAGE is not 242 -update

    To close the video, you can press ESC or click the red Terminate icon from the Console at any time. The video will close automatically when it reaches the end of the playback.

Modify your project to run on the GPU

Next, you'll modify the project to run on a GPU.

  1. Back in the Project Explorer, make sure you still have the security_barrier_camera_demo folder selected.
  2. Run drop-down list in the toolbar, select Run Configurations.
  3. C/C++ Application, select security_barrier_camera_demo.
  4. Click the Arguments
    Next, you'll change the existing program arguments to run the project on the GPU.

    This information and more details about the arguments you can supply to the sample can be found in the README.md file in the security_barrier_camera_demo source files.

  5. Copy the following argument string
    -t 0 -d GPU -d_va GPU -d_lpr GPU -i "/home/ieisw/Downloads/car-detection.mp4" -m "${MODEL_DIR}/Security/object_detection/barrier/0106/dldt/FP16/vehicle-license-plate-detection-barrier-0106.xml" -m_va "${MODEL_DIR}/Security/object_attributes/vehicle/resnet10_update_1/dldt/FP16/vehicle-attributes-recognition-barrier-0039.xml" -m_lpr "${MODEL_DIR}/Security/optical_character_recognition/license_plate/dldt/FP16/license-plate-recognition-barrier-0001.xml"
  6. Paste the string into Program arguments field.
  7. Once finished, click Run.

Your project runs. The results appear in the Console and in a separate video window. In the video, you'll see several cars driving through a parking lot. The application will highlight the vehicles it detects in bounding boxes and display a label next to each car ("white car", "red car", etc.).

In the text displayed over the video, you can see live data about the sample. Note the fps value, which you can use to estimate performance. A higher fps value corresponds to better performance.

Intel® technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. Check with your system manufacturer or retailer.

If you have the System Monitor open, you can see the CPU utilization spike as the project runs. Compared to running the project on the CPU only, only about one CPU core is utilized at 100% at a time, as work is being offloaded to the GPU.

To close the video, you can press ESC or click the red Terminate icon from the Console at any time. The video will close automatically when it reaches the end of the playback.

Note: To loop the video, add the argument -loop video to the end of the arguments, then rerun the sample project.

After the video closes automatically, you can check the Console for averaged statistics about the sample you just ran, including the fps data.

Next Steps

Next, you can modify the project to offload the application processing to different hardware, as follows:

Modify your Vehicle Detection project to run on IEI Tank* Mustang V100-MX8 AI Acceleration Card 

This section contains steps to modify your vehicle detection application to run on an IEI* Mustang-V100-MX8 accelerator card.

Intel® technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. Check with your system manufacturer or retailer.

Before you begin

These steps were tested with the following configuration:

  • IEI Tank* AIoT Dev Kit with Intel® System Studio 2019 Update 4
  • Version 2019 R2 of the Intel® Distribution of OpenVINO™ toolkit
  • IEI* Mustang-V100-MX8 accelerator card

Set up service configuration for running Security Barrier Demo with the IEI* Mustang-V100-MX8 AI acceleration card

For the security barrier camera demo, the configuration file needs to include the following in the hddl_service.config file. Before editing a config file, remember to create a backup file of the original.

cd /opt/intel/openvino/deployment_tools/inference_engine/external/hddl/config

Backup the original config file.

sudo cp hddl_service.config hddl_service.config.orig

Use your favorite editor to edit the file. In this case, we use nano.

sudo nano hddl_service.config

Edit the config file  in the scheduler_config section with the content below.

  "tagDetect":           6,         "tagAttr":                1,           "tagLPR":               1

"scheduler_config":
  [
    {
      "subclass":             0,                 // firmware interface subclass
      // Tag Scheduler
      "graph_tag_map":{                          // graph tag mapping
       "tagDetect":           6,         
       "tagAttr":             1,           
       "tagLPR":              1
     },
      // Stream Scheduler

Exit the editor. With nano, use ctrl+x. Follow the instruction to save, and click the Enter key to write the changes  to the file. Now, you are ready to get started withe IEI* Mustang-V100-MX8 card.

Run the sample project on the IEI* Mustang-V100-MX8 accelerator card

  1. In the Project Explorer, make sure you still have the security_barrier_camera_demo folder selected.
  2. From the Run drop-down list in the toolbar, select Run Configurations.
  3. Under C/C++ Application, select the security barrier camera demo run configuration.
  4. Click the Arguments tab.
    Next, you'll change the existing program arguments to run the project on the accelerator card, and to change the model for the accelerator card to a 16-bit version compatible with the hardware. This information and more details about the arguments you can supply to the sample can be found in the README.md file in the security_barrier_camera_demo source files.
  5. Copy the following argument string:
    -d HDDL -d_va HDDL -d_lpr HDDL -i "/home/ieisw/Downloads/car-detection.mp4" -m "/opt/intel/openvino/deployment_tools/tools/model_downloader/Security/object_detection/barrier/0106/dldt/vehicle-license-plate-detection-barrier-0106.xml" -m_va "/opt/intel/openvino/deployment_tools/tools/model_downloader/Security/object_attributes/vehicle/resnet10_update_1/dldt/vehicle-attributes-recognition-barrier-0039.xml" -m_lpr "/opt/intel/openvino/deployment_tools/tools/model_downloader/Security/optical_character_recognition/license_plate/dldt/license-plate-recognition-barrier-0001.xml" -n_wt 30 -n_iqs 10 -nireq 50 -tag
  6. Paste the string into the Program arguments field.
  7. Once finished, click Run.Your project runs. The results appear in the Console and in a separate video window. In the video, you'll see several cars driving through a parking lot. The application will highlight the vehicles it detects in bounding boxes and display a label next to each car ("white car", "red car", etc.).
  8. In the text displayed over the video, you can see live data about the sample. Note the fps value, which you can use to estimate performance; a higher fps value corresponds to better performance.
    If you have the System Monitor open, you can see the CPU utilization rise as the project runs.

  9. After the video closes automatically, you can check the Console for averaged statistics about the sample you just ran, including the fps data.
[ INFO ] InferenceEngine: 
API version ............ 2.0
Build .................. custom_releases/2019/R2_f5827d4773ebbe727c9acac5f007f7d94dd4be4e
Description ....... API
[ INFO ] Files were added: 1
[ INFO ]     /home/ieisw/Downloads/car-detection.mp4
[ INFO ] Loading device HDDL
HDDL
HDDLPlugin version ......... 2.0
Build ........... 27579

[ INFO ] Loading detection model to the HDDL plugin
[10:41:24.3173][4925]I[ServiceStarter.cpp:40] Info: Waiting for HDDL Service getting ready ...
[10:41:24.3173][4925]I[ServiceStarter.cpp:45] Info: Found HDDL Service is running.
[HDDLPlugin] [10:41:24.3174][4925]I[HddlClient.cpp:256] Hddl api version: 2.2
[HDDLPlugin] [10:41:24.3175][4925]I[HddlClient.cpp:259] Info: Create Dispatcher2.
[HDDLPlugin] [10:41:24.3176][4925]I[HddlClient.cpp:270] Info: RegisterClient HDDLPlugin.
[HDDLPlugin] [10:41:24.3177][4937]I[Dispatcher2.cpp:148] Info: SenderRoutine starts.
[HDDLPlugin] [10:41:24.3182][4925]I[HddlClient.cpp:275] Client Id: 2
[ INFO ] Loading Vehicle Attribs model to the HDDL plugin
[HDDLPlugin] [10:41:25.6208][4925]I[ServiceStarter.cpp:40] Info: Waiting for HDDL Service getting ready ...
[HDDLPlugin] [10:41:25.6209][4925]I[ServiceStarter.cpp:45] Info: Found HDDL Service is running.
[HDDLPlugin] [10:41:25.6211][4925]I[HddlClient.cpp:256] Hddl api version: 2.2
[HDDLPlugin] [10:41:25.6212][4925]I[HddlClient.cpp:259] Info: Create Dispatcher2.
[HDDLPlugin] [10:41:25.6215][4958]I[Dispatcher2.cpp:148] Info: SenderRoutine starts.
[HDDLPlugin] [10:41:25.6220][4925]I[HddlClient.cpp:270] Info: RegisterClient HDDLPlugin.
[HDDLPlugin] [10:41:25.6228][4925]I[HddlClient.cpp:275] Client Id: 3
[ INFO ] Loading Licence Plate Recognition (LPR) model to the HDDL plugin
[HDDLPlugin] [10:41:25.7543][4925]I[ServiceStarter.cpp:40] Info: Waiting for HDDL Service getting ready ...
[HDDLPlugin] [10:41:25.7543][4925]I[ServiceStarter.cpp:45] Info: Found HDDL Service is running.
[HDDLPlugin] [10:41:25.7544][4925]I[HddlClient.cpp:256] Hddl api version: 2.2
[HDDLPlugin] [10:41:25.7544][4925]I[HddlClient.cpp:259] Info: Create Dispatcher2.
[HDDLPlugin] [10:41:25.7545][4966]I[Dispatcher2.cpp:148] Info: SenderRoutine starts.
[HDDLPlugin] [10:41:25.7548][4925]I[HddlClient.cpp:270] Info: RegisterClient HDDLPlugin.
[HDDLPlugin] [10:41:25.7552][4925]I[HddlClient.cpp:275] Client Id: 4
[ INFO ] Number of InferRequests: 50
[ INFO ] Display resolution: 1920x1080
[HDDLPlugin] [10:41:25.8545][4925]I[HddlBlob.cpp:166] Info: HddlBlob initialize ion ...
[HDDLPlugin] [10:41:25.8545][4925]I[HddlBlob.cpp:176] Info: HddlBlob initialize ion successfully.
[ INFO ] Number of allocated frames: 10
[ INFO ] Resizable input with support of ROI crop and auto resize is disabled
Mean overall time per all inputs: 5.55ms / 180.27FPS for 373 frames
Detection InferRequests usage: 13.50%
[HDDLPlugin] [10:41:28.0755][4967]I[Dispatcher2.cpp:212] Info: Listen Thread wake up and to exit.
[HDDLPlugin] [10:41:28.0758][4925]I[Dispatcher2.cpp:81] Info: Client dispatcher exit.
[HDDLPlugin] [10:41:28.0760][4925]I[HddlClient.cpp:203] Info: Hddl client unregistered.
[HDDLPlugin] [10:41:28.1769][4959]I[Dispatcher2.cpp:212] Info: Listen Thread wake up and to exit.
[HDDLPlugin] [10:41:28.1771][4925]I[Dispatcher2.cpp:81] Info: Client dispatcher exit.
[HDDLPlugin] [10:41:28.1773][4925]I[HddlClient.cpp:203] Info: Hddl client unregistered.
[HDDLPlugin] [10:41:28.2781][4938]I[Dispatcher2.cpp:212] Info: Listen Thread wake up and to exit.
[HDDLPlugin] [10:41:28.2783][4925]I[Dispatcher2.cpp:81] Info: Client dispatcher exit.
[HDDLPlugin] [10:41:28.2785][4925]I[HddlClient.cpp:203] Info: Hddl client unregistered.
[ INFO ] Execution successful

To close the video, you can press ESC or click the red Terminate icon from the Console at any time. The video will close automatically when it reaches the end of the playback.

Note: To loop the video, add the argument -loop_video to the end of the arguments, then rerun the sample project.

Troubleshooting

For more information about HDDL-R and troubleshooting tips, visit: Configuration Guide for the Intel® Distribution of OpenVINO™ toolkit and the Intel® Vision Accelerator Design with Intel® Movidius™ VPUs on Linux*.

For information about the reset driver for HDDL from IEI*, visit: their Download Center for Mustang V100 MX8

Projects and Tutorials

This section contains tutorials for developing projects for and working with your system.

Reference implementations, code samples, and additional documentation

You can check out the following reference implementations for steps to leverage your system to create some realworld solutions:

You can also view additional code samples and OpenVINO™ toolkit documentation.

Debugging your project

  1. To debug your project, click the Debug drop-down list in the toolbar, and click the name of your project. If you see a message asking you to open the debug perspective, click Yes.

    The debug perspective opens.

  2. To return to the C/C++ perspective once you're finished debugging, click the blue C/C++ icon in the top right of the application.

    Note: If you don't see the C/C++ icon, you can instead go to the menu and choose Window > Perspective > Open Perspective > C/C++ to exit the debug perspective.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.