Beautiful Sakura 1 Beautiful Sakura 2 Beautiful Sakura 3
Beautiful Sakura 1 Beautiful Sakura 2 Beautiful Sakura 3
Beautiful Sakura 4 Beautiful Sakura 5 Beautiful Sakura 6
Beautiful Sakura 4 Beautiful Sakura 5 Beautiful Sakura 6
Beautiful Sakura 7 Beautiful Sakura 8 Beautiful Sakura 9
Beautiful Sakura 7 Beautiful Sakura 8 Beautiful Sakura 9

For simplicity, let's just pick up Python Server way to install Netron by pip install --user netron. After installation:

1
2
3
4
5
6
7
8
9
10
11
➜  ~ pip show netron
Name: netron
Version: 4.0.6
Summary: Viewer for neural network, deep learning and machine learning models
Home-page: https://github.com/lutzroeder/netron
Author: Lutz Roeder
Author-email: lutzroeder@users.noreply.github.com
License: MIT
Location: /home/longervision/.local/lib/python3.6/site-packages
Requires:
Required-by:

We then test out some popular models, including - a onnx Alexnet model: bvlcalexnet-9.onnx - a caffe model trained by BAIR: finetune_flickr_style.caffemodel - a Tensorflow model provided by Google Brain on Kaggle: Inception-v3

bvlcalexnet-9.onnx finetune_flickr_style.caffemodel
bvlcalexnet-9.onnx finetune_flickr_style.caffemodel

inception_v3.ckpt

Today is Easter Sunday, Prime minister of United Kindom Boris Johnson recovered from COVID-19. Canada has been suffereing COVID-19 for a month already. I'm re-writing this blog FIRSTLY written in September 2019, and UPDATED ONCE in December 2019.

Merry Christmas and happy new year everybody. I’ve been back to Vancouver for several days. These days, I’m updating this blog FIRSTLY written in September 2019. 2020 is coming, and we’re getting 1 year older. A kind of sad hum?

😝

Okay… No matter what, let’s enjoy the song first: WE ARE YOUNG. Today, I joined Free Software Foundation and start my journey of supporting Open Source Software BY CASH. For me, it’s not about poverity or richness. It’s ALL about FAITH.

To write something about Raspberry Pi is to say GOOD BYE to my Raspberry Pi 3B, and WELCOME Raspberry Pi 4 at the same time. Our target today is to build an AI edge computing end as the following Youtube video:

1. About Raspberry Pi 4

1.1 Raspberry Pi 4 vs. Raspberry Pi 3B+

Before we start, let’s carry out a simple comparison between Raspberry Pi 4 and Raspberry Pi 3B+.

1.2 Raspbian Installation

1
2
3
4
5
➜  raspbian sudo dd bs=4M if=2020-02-13-raspbian-buster.img of=/dev/mmcblk0 conv=fsync 
[sudo] password for longervision:
903+0 records in
903+0 records out
3787456512 bytes (3.8 GB, 3.5 GiB) copied, 198.861 s, 19.0 MB/s

1.3 BCM2711 is detected as BCM2835

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
➜  ~ cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 108.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3

processor : 1
model name : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 108.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3

processor : 2
model name : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 108.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3

processor : 3
model name : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 108.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3

Hardware : BCM2835
Revision : c03111
Serial : 100000006c0c9b01
Model : Raspberry Pi 4 Model B Rev 1.1

This issue seems to be a well-known bug. Raspberry Pi 4’s specification can be retrieved from The MagPi Magazine. More details about the development history of Raspberry Pi can be found on Wikipedia.

2. Movidius Neural Compute Stick on Raspberry Pi 4

Then, we just follow the following 2 blogs Run NCS Applications on Raspberry Pi and Adding AI to the Raspberry Pi with the Movidius Neural Compute Stick to test out Intel Movidius Neural Compute Stick 2:

Intel Movidius Neural Compute Stick 2 Intel Movidius Neural Compute Stick 1
Intel Movidius Neural Compute Stick 2 Intel Movidius Neural Compute Stick 1

Intel Movidius Neural Compute Stick 1 is NOT listed on Intel’s official website any more. But github support for Intel Movidius Neural Compute Stick 1 can be found at https://github.com/movidius/ncsdk.

2.1 NCSDK Installation

We FIRST need to have ncsdk installed. Yup, here, as described in Run NCS Applications on Raspberry Pi, we carry out the installation directly under folder ...../ncsdk/api/src.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
➜  src make
cc -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/shared -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/pc -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLinkConsole/pc -I /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/swCommon/include/ -I /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/shared/include/ -D__PC__ -DUSE_USB_VSC -DVERSION_NAME="\"`cat ./version.txt`\"" -DDEVICE_SHELL_ENABLED -DEXCLUDE_HIGHCLASS -O2 -Wall -pthread -fPIC -MMD -MP -I. -I../include -I/usr/include/libusb-1.0 -c mvnc_api.c -o obj-armv7l/mvnc_api.o
mvnc_api.c:457:12: warning: ‘deviceGetNumberOfDevices’ defined but not used [-Wunused-function]
static int deviceGetNumberOfDevices()
^~~~~~~~~~~~~~~~~~~~~~~~
mvnc_api.c: In function ‘ncGraphCreate’:
mvnc_api.c:898:5: warning: ‘strncpy’ specified bound 28 equals destination size [-Wstringop-truncation]
strncpy(g->name, name, NC_MAX_NAME_SIZE);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mvnc_api.c: In function ‘ncFifoCreate’:
mvnc_api.c:2210:5: warning: ‘strncpy’ specified bound 28 equals destination size [-Wstringop-truncation]
strncpy(handle->name, name, NC_MAX_NAME_SIZE);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/shared -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/pc -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLinkConsole/pc -I /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/swCommon/include/ -I /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/shared/include/ -D__PC__ -DUSE_USB_VSC -DVERSION_NAME="\"`cat ./version.txt`\"" -DDEVICE_SHELL_ENABLED -DEXCLUDE_HIGHCLASS -O2 -Wall -pthread -fPIC -MMD -MP -I. -I../include -I/usr/include/libusb-1.0 -c fp16.c -o obj-armv7l/fp16.o
cc -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/shared -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/pc -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLinkConsole/pc -I /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/swCommon/include/ -I /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/shared/include/ -D__PC__ -DUSE_USB_VSC -DVERSION_NAME="\"`cat ./version.txt`\"" -DDEVICE_SHELL_ENABLED -DEXCLUDE_HIGHCLASS -O2 -Wall -pthread -fPIC -MMD -MP -I. -I../include -I/usr/include/libusb-1.0 -c /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/pc/usb_boot.c -o obj-armv7l//home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/pc/usb_boot.o
cc -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/shared -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/pc -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLinkConsole/pc -I /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/swCommon/include/ -I /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/shared/include/ -D__PC__ -DUSE_USB_VSC -DVERSION_NAME="\"`cat ./version.txt`\"" -DDEVICE_SHELL_ENABLED -DEXCLUDE_HIGHCLASS -O2 -Wall -pthread -fPIC -MMD -MP -I. -I../include -I/usr/include/libusb-1.0 -c /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/pc/pcie_host.c -o obj-armv7l//home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/pc/pcie_host.o
cc -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/shared -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/pc -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLinkConsole/pc -I /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/swCommon/include/ -I /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/shared/include/ -D__PC__ -DUSE_USB_VSC -DVERSION_NAME="\"`cat ./version.txt`\"" -DDEVICE_SHELL_ENABLED -DEXCLUDE_HIGHCLASS -O2 -Wall -pthread -fPIC -MMD -MP -I. -I../include -I/usr/include/libusb-1.0 -c /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/shared/XLink.c -o obj-armv7l//home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/shared/XLink.o
cc -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/shared -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/pc -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLinkConsole/pc -I /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/swCommon/include/ -I /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/shared/include/ -D__PC__ -DUSE_USB_VSC -DVERSION_NAME="\"`cat ./version.txt`\"" -DDEVICE_SHELL_ENABLED -DEXCLUDE_HIGHCLASS -O2 -Wall -pthread -fPIC -MMD -MP -I. -I../include -I/usr/include/libusb-1.0 -c /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/shared/XLinkDispatcher.c -o obj-armv7l//home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/shared/XLinkDispatcher.o
cc -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/shared -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/pc -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLinkConsole/pc -I /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/swCommon/include/ -I /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/shared/include/ -D__PC__ -DUSE_USB_VSC -DVERSION_NAME="\"`cat ./version.txt`\"" -DDEVICE_SHELL_ENABLED -DEXCLUDE_HIGHCLASS -O2 -Wall -pthread -fPIC -MMD -MP -I. -I../include -I/usr/include/libusb-1.0 -c /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLinkConsole/pc/XLinkConsole.c -o obj-armv7l//home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLinkConsole/pc/XLinkConsole.o
/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLinkConsole/pc/XLinkConsole.c: In function ‘shellThreadWriter’:
/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLinkConsole/pc/XLinkConsole.c:44:33: warning: pointer targets in passing argument 2 of ‘XLinkWriteData’ differ in signedness [-Wpointer-sign]
XLinkWriteData(cId, str, bytes);
^~~
In file included from /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLinkConsole/pc/XLinkConsole.c:18:
/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/shared/XLink.h:54:14: note: expected ‘const uint8_t *’ {aka ‘const unsigned char *’} but argument is of type ‘char *’
XLinkError_t XLinkWriteData(streamId_t streamId, const uint8_t* buffer, int size);
^~~~~~~~~~~~~~
/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLinkConsole/pc/XLinkConsole.c: In function ‘shellThreadReader’:
/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLinkConsole/pc/XLinkConsole.c:81:5: warning: implicit declaration of function ‘pthread_create’ [-Wimplicit-function-declaration]
pthread_create(&shellWriter, NULL, shellThreadWriter, (void*) context);
^~~~~~~~~~~~~~
cc -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/shared -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/pc -I/home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLinkConsole/pc -I /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/swCommon/include/ -I /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/shared/include/ -D__PC__ -DUSE_USB_VSC -DVERSION_NAME="\"`cat ./version.txt`\"" -DDEVICE_SHELL_ENABLED -DEXCLUDE_HIGHCLASS -O2 -Wall -pthread -fPIC -MMD -MP -I. -I../include -I/usr/include/libusb-1.0 -c /home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/pc/XLinkPlatform.c -o obj-armv7l//home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/pc/XLinkPlatform.o
if [ ! -e ./version.txt ] ; then echo "missing version.txt file"; exit 1; fi;
cc -shared obj-armv7l/mvnc_api.o obj-armv7l/fp16.o obj-armv7l//home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/pc/usb_boot.o obj-armv7l//home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/pc/pcie_host.o obj-armv7l//home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/shared/XLink.o obj-armv7l//home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/shared/XLinkDispatcher.o obj-armv7l//home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLinkConsole/pc/XLinkConsole.o obj-armv7l//home/pi/Downloads/ncsdk-2.10.01.01/api/src/common/components/XLink/pc/XLinkPlatform.o -o obj-armv7l/libmvnc.so.0 -lpthread -lusb-1.0 -ldl
ln -fs obj-armv7l/libmvnc.so.0 libmvnc.so
ln -fs obj-armv7l/libmvnc.so.0 libmvnc.so.0
NCSDK FW successfully installed
➜ src sudo make install
NCSDK FW successfully installed
mkdir -p /usr/local/include/
mkdir -p /usr/local/include/mvnc2
mkdir -p /usr/local/lib/
cp obj-armv7l/libmvnc.so.0 /usr/local/lib/
ln -fs libmvnc.so.0 /usr/local/lib/libmvnc.so
cp ../include/mvnc.h /usr/local/include/mvnc2
ln -fs /usr/local/include/mvnc2/mvnc.h /usr/local/include/mvnc.h
mkdir -p /usr/local/lib/mvnc
cp mvnc/MvNCAPI-*.mvcmd /usr/local/lib/mvnc/
mkdir -p /etc/udev/rules.d/
cp 97-usbboot.rules /etc/udev/rules.d/
mkdir -p /usr/local/lib/python3.7/dist-packages
mkdir -p /usr/local/lib/python3.7/dist-packages
cp -r ../python/mvnc /usr/local/lib/python3.7/dist-packages/
cp -r ../python/mvnc /usr/local/lib/python3.7/dist-packages/
udevadm control --reload-rules
udevadm trigger
ldconfig
➜ src

2.2 Test NCSDK Example Apps

2.2.1 For Movidius NCS 1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
➜  hello_ncs_py lsusb
......
Bus 001 Device 004: ID 03e7:2150 Intel Myriad VPU [Movidius Neural Compute Stick]
......
➜ hello_ncs_py python hello_ncs.py
D: [ 0] ncDeviceCreate:307 ncDeviceCreate index 0
D: [ 0] ncDeviceCreate:307 ncDeviceCreate index 1
D: [ 0] ncDeviceOpen:523 File path /usr/local/lib/mvnc/MvNCAPI-ma2450.mvcmd
I: [ 0] ncDeviceOpen:529 ncDeviceOpen() XLinkBootRemote returned success 0
I: [ 0] ncDeviceOpen:567 XLinkConnect done - link Id 0
D: [ 0] ncDeviceOpen:581 done
I: [ 0] ncDeviceOpen:583 Booted 1.1-ma2450 -> VSC
I: [ 0] getDevAttributes:382 Device attributes
I: [ 0] getDevAttributes:385 Device FW version: 2.a.2450.8a
I: [ 0] getDevAttributes:387 mvTensorVersion 2.10
I: [ 0] getDevAttributes:388 Maximum graphs: 10
I: [ 0] getDevAttributes:389 Maximum fifos: 20
I: [ 0] getDevAttributes:391 Maximum graph option class: 1
I: [ 0] getDevAttributes:393 Maximum device option class: 1
I: [ 0] getDevAttributes:394 Device memory capacity: 522047856
Hello NCS! Device opened normally.
I: [ 0] ncDeviceClose:775 closing device
Goodbye NCS! Device closed normally.
NCS device working.

2.2.2 For Movidius NCS 2

1
2
3
4
5
6
7
8
9
10
➜  hello_ncs_py lsusb
......
Bus 001 Device 007: ID 03e7:2485 Intel Movidius MyriadX
......
➜ hello_ncs_py python hello_ncs.py
D: [ 0] ncDeviceCreate:307 ncDeviceCreate index 0
D: [ 0] ncDeviceCreate:307 ncDeviceCreate index 1
D: [ 0] ncDeviceOpen:523 File path /usr/local/lib/mvnc/MvNCAPI-ma2480.mvcmd
W: [ 0] ncDeviceOpen:527 ncDeviceOpen() XLinkBootRemote returned error 3
Error - Could not open NCS device.

The above bug has ALREADY been expalined in main online resource:

All these hint that OpenVINO should be utilized instead of NCSDK2.

2.3 mvnc Python Package

1
2
3
4
5
6
7
8
➜  ~ python
Python 3.7.3 (default, Dec 20 2019, 18:57:59)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mvnc
>>> mvnc.__file__
'/usr/local/lib/python3.7/dist-packages/mvnc/__init__.py'
>>>

3. Transitioning from Intel Movidius Neural Compute SDK to Intel OpenVINO

By following Intel’s official documentation Transitioning from Intel® Movidius™ Neural Compute SDK to Intel® Distribution of OpenVINO™ toolkit, we are transitioning to OpenVINO, which supports both Intel NCS 2 and Intel NCS 1.

3.1 Install OpenVINO for Raspbian

For the installation details of OpenVINO, please refer to the following 2 documentations:

We now extract the MOST up-to-date l_openvino_toolkit_runtime_raspbian_p_2020.3.220.tgz under folder /opt/intel/openvino. Let’s take a brief look at this folder:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
➜  openvino pwd
/opt/intel/openvino
➜ openvino ll
total 28K
drwxr-xr-x 2 pi pi 4.0K Jan 27 08:06 bin
drwxr-xr-x 4 pi pi 4.0K Jan 27 08:06 deployment_tools
drwxr-xr-x 2 pi pi 4.0K Jan 27 08:08 documentation
lrwxrwxrwx 1 pi pi 33 Jan 27 08:04 inference_engine -> deployment_tools/inference_engine
drwxr-xr-x 2 pi pi 4.0K Jan 27 08:08 install_dependencies
drwxr-xr-x 5 pi pi 4.0K Jan 27 08:08 licensing
drwxr-xr-x 8 pi pi 4.0K Jan 27 08:09 opencv
drwxr-xr-x 6 pi pi 4.0K Jan 27 08:09 python
➜ openvino ls inference_engine
external include lib samples share version.txt

Clearly, by comparing with OpenVINO™ Toolkit - Deep Learning Deployment Toolkit repository, we know that the open source version of deployment_tools contains some more content than the trimmed version for Raspbian. We’ll use model-optimizer for sure. Therefore, we checked out dldt, and put it under folder /opt/intel.

1
2
3
4
5
6
7
➜  intel pwd
/opt/intel
➜ intel ll
total 12K
drwxr-xr-x 8 pi pi 4.0K Apr 7 06:37 dldt
drwxr-xr-x 9 pi pi 4.0K Apr 7 14:04 l_openvino_toolkit_runtime_raspbian_p_2020.1.023
lrwxrwxrwx 1 root root 48 Apr 7 06:29 openvino -> l_openvino_toolkit_runtime_raspbian_p_2020.1.023

3.2 Build OpenVINO Samples

Before start building OpenVINO samples, please have OpenCV built from source and installed. You can of course directly run the command build_samples.sh to build ALL samples. However, I personally would like you to build and install OpenCV from source FIRST.

Note: Be sure to enable -DCMAKE_CXX_FLAGS=’-march=armv7-a’ while building dldt/samples, which is exactly the same as the source under l_openvino_toolkit_runtime_raspbian_p_2020.1.023/inference_engine/samples/cpp. In fact, to build l_openvino_toolkit_runtime_raspbian_p_2020.1.023/inference_engine/samples/c, -DCMAKE_CXX_FLAGS=’-march=armv7-a’ also needs to be enabled.

After having successfully built C/C++ samples, let's enter folder /opt/intel/openvino/inference_engine/samples.

3.3 Device Query

3.2.1 C

There is NO such an exe file hello_query_device_c.

3.2.2 C++

For NCS 2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
➜  samples $ ./cpp/build/armv7l/Release/hello_query_device
Available devices:
Device: MYRIAD
Metrics:
DEVICE_THERMAL : UNSUPPORTED TYPE
RANGE_FOR_ASYNC_INFER_REQUESTS : { 3, 6, 1 }
SUPPORTED_CONFIG_KEYS : [ CONFIG_FILE PERF_COUNT EXCLUSIVE_ASYNC_REQUESTS DEVICE_ID VPU_MYRIAD_PLATFORM VPU_IGNORE_IR_STATISTIC VPU_CUSTOM_LAYERS VPU_MYRIAD_FORCE_RESET VPU_PRINT_RECEIVE_TENSOR_TIME LOG_LEVEL VPU_HW_STAGES_OPTIMIZATION ]
SUPPORTED_METRICS : [ DEVICE_THERMAL RANGE_FOR_ASYNC_INFER_REQUESTS SUPPORTED_CONFIG_KEYS SUPPORTED_METRICS OPTIMIZATION_CAPABILITIES FULL_DEVICE_NAME AVAILABLE_DEVICES ]
OPTIMIZATION_CAPABILITIES : [ FP16 ]
FULL_DEVICE_NAME : Intel Movidius Myriad X VPU
Default values for device configuration keys:
CONFIG_FILE : ""
PERF_COUNT : OFF
EXCLUSIVE_ASYNC_REQUESTS : OFF
DEVICE_ID : ""
VPU_MYRIAD_PLATFORM : ""
VPU_IGNORE_IR_STATISTIC : OFF
VPU_CUSTOM_LAYERS : ""
VPU_MYRIAD_FORCE_RESET : OFF
VPU_PRINT_RECEIVE_TENSOR_TIME : OFF
LOG_LEVEL : LOG_NONE
VPU_HW_STAGES_OPTIMIZATION : ON

For NCS 1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
➜  samples ./cpp/build/armv7l/Release/hello_query_device
Available devices:
Device: MYRIAD
Metrics:
DEVICE_THERMAL : UNSUPPORTED TYPE
RANGE_FOR_ASYNC_INFER_REQUESTS : { 3, 6, 1 }
SUPPORTED_CONFIG_KEYS : [ CONFIG_FILE PERF_COUNT EXCLUSIVE_ASYNC_REQUESTS DEVICE_ID VPU_MYRIAD_PLATFORM VPU_IGNORE_IR_STATISTIC VPU_CUSTOM_LAYERS VPU_MYRIAD_FORCE_RESET VPU_PRINT_RECEIVE_TENSOR_TIME LOG_LEVEL VPU_HW_STAGES_OPTIMIZATION ]
SUPPORTED_METRICS : [ DEVICE_THERMAL RANGE_FOR_ASYNC_INFER_REQUESTS SUPPORTED_CONFIG_KEYS SUPPORTED_METRICS OPTIMIZATION_CAPABILITIES FULL_DEVICE_NAME AVAILABLE_DEVICES ]
OPTIMIZATION_CAPABILITIES : [ FP16 ]
FULL_DEVICE_NAME : Intel Movidius Myriad 2 VPU
Default values for device configuration keys:
CONFIG_FILE : ""
PERF_COUNT : OFF
EXCLUSIVE_ASYNC_REQUESTS : OFF
DEVICE_ID : ""
VPU_MYRIAD_PLATFORM : ""
VPU_IGNORE_IR_STATISTIC : OFF
VPU_CUSTOM_LAYERS : ""
VPU_MYRIAD_FORCE_RESET : OFF
VPU_PRINT_RECEIVE_TENSOR_TIME : OFF
LOG_LEVEL : LOG_NONE
VPU_HW_STAGES_OPTIMIZATION : ON

3.2.3 Python

For NCS 2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
➜  samples python ./python/hello_query_device/hello_query_device.py
Available devices:
Device: MYRIAD
Metrics:
DEVICE_THERMAL: UNSUPPORTED TYPE
RANGE_FOR_ASYNC_INFER_REQUESTS: 3, 6, 1
SUPPORTED_CONFIG_KEYS: CONFIG_FILE, PERF_COUNT, EXCLUSIVE_ASYNC_REQUESTS, DEVICE_ID, VPU_MYRIAD_PLATFORM, VPU_IGNORE_IR_STATISTIC, VPU_CUSTOM_LAYERS, VPU_MYRIAD_FORCE_RESET, VPU_PRINT_RECEIVE_TENSOR_TIME, LOG_LEVEL, VPU_HW_STAGES_OPTIMIZATION
SUPPORTED_METRICS: DEVICE_THERMAL, RANGE_FOR_ASYNC_INFER_REQUESTS, SUPPORTED_CONFIG_KEYS, SUPPORTED_METRICS, OPTIMIZATION_CAPABILITIES, FULL_DEVICE_NAME, AVAILABLE_DEVICES
OPTIMIZATION_CAPABILITIES: FP16
FULL_DEVICE_NAME: Intel Movidius Myriad X VPU
AVAILABLE_DEVICES: 1.1.1-ma2480

Default values for device configuration keys:
CONFIG_FILE:
PERF_COUNT: OFF
EXCLUSIVE_ASYNC_REQUESTS: OFF
DEVICE_ID:
VPU_MYRIAD_PLATFORM:
VPU_IGNORE_IR_STATISTIC: OFF
VPU_CUSTOM_LAYERS:
VPU_MYRIAD_FORCE_RESET: OFF
VPU_PRINT_RECEIVE_TENSOR_TIME: OFF
LOG_LEVEL: LOG_NONE
VPU_HW_STAGES_OPTIMIZATION: ON

For NCS 1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
➜  samples python ./python/hello_query_device/hello_query_device.py
Available devices:
Device: MYRIAD
Metrics:
DEVICE_THERMAL: UNSUPPORTED TYPE
RANGE_FOR_ASYNC_INFER_REQUESTS: 3, 6, 1
SUPPORTED_CONFIG_KEYS: CONFIG_FILE, PERF_COUNT, EXCLUSIVE_ASYNC_REQUESTS, DEVICE_ID, VPU_MYRIAD_PLATFORM, VPU_IGNORE_IR_STATISTIC, VPU_CUSTOM_LAYERS, VPU_MYRIAD_FORCE_RESET, VPU_PRINT_RECEIVE_TENSOR_TIME, LOG_LEVEL, VPU_HW_STAGES_OPTIMIZATION
SUPPORTED_METRICS: DEVICE_THERMAL, RANGE_FOR_ASYNC_INFER_REQUESTS, SUPPORTED_CONFIG_KEYS, SUPPORTED_METRICS, OPTIMIZATION_CAPABILITIES, FULL_DEVICE_NAME, AVAILABLE_DEVICES
OPTIMIZATION_CAPABILITIES: FP16
FULL_DEVICE_NAME: Intel Movidius Myriad 2 VPU
AVAILABLE_DEVICES: 1.1.1-ma2450

Default values for device configuration keys:
CONFIG_FILE:
PERF_COUNT: OFF
EXCLUSIVE_ASYNC_REQUESTS: OFF
DEVICE_ID:
VPU_MYRIAD_PLATFORM:
VPU_IGNORE_IR_STATISTIC: OFF
VPU_CUSTOM_LAYERS:
VPU_MYRIAD_FORCE_RESET: OFF
VPU_PRINT_RECEIVE_TENSOR_TIME: OFF
LOG_LEVEL: LOG_NONE
VPU_HW_STAGES_OPTIMIZATION: ON

3.3 Object Detection

Please refer to Device-specific Plugin Libraries for ALL possible device types.

We then download two model files as given in the blog Install OpenVINO™ toolkit for Raspbian* OS.

Please note that:

Afterwards, start running Object Detection for 2 images: me.jpg and parents.jpg:

3.3.1 C

For NCS 2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
➜  samples ./c/build/armv7l/Release/object_detection_sample_ssd_c -m face-detection-adas-0001.xml -d MYRIAD -i parents.jpg
[ INFO ] InferenceEngine:
2.1.2020.3.0-3467-15f2c61a-releases/2020/3
[ INFO ] Parsing input parameters
[ INFO ] Files were added: 1
[ INFO ] parents.jpg
[ INFO ] Loading Inference Engine
[ INFO ] Device info:
MYRIAD
myriadPlugin version ......... 2.1
Build ......... 2020.3.0-3467-15f2c61a-releases/2020/3
[ INFO ] Loading network files:
face-detection-adas-0001.xml
face-detection-adas-0001.bin
[ INFO ] Preparing input blobs
[ WARNING ] Image is resized from (1280, 960) to (672, 384)
[ INFO ] Batch size is 1
[ INFO ] Preparing output blobs
[ INFO ] Loading model to the device
[ INFO ] Create infer request
[ INFO ] Start inference
[ INFO ] Processing output blobs
[0, 1] element, prob = 1.000000 (826, 366)-(1026, 644) batch id : 0 WILL BE PRINTED!
[1, 1] element, prob = 0.996582 (539, 173)-(693, 429) batch id : 0 WILL BE PRINTED!
[2, 1] element, prob = 0.539062 (1094, 47)-(1135, 96) batch id : 0 WILL BE PRINTED!
[3, 1] element, prob = 0.212402 (848, 22)-(886, 70) batch id : 0
[4, 1] element, prob = 0.052734 (7, 783)-(151, 957) batch id : 0
[5, 1] element, prob = 0.039551 (1033, 78)-(1070, 122) batch id : 0
[6, 1] element, prob = 0.034668 (1123, 75)-(1158, 122) batch id : 0
[7, 1] element, prob = 0.032227 (1091, 109)-(1130, 171) batch id : 0
[8, 1] element, prob = 0.032227 (1086, 14)-(1138, 85) batch id : 0
[9, 1] element, prob = 0.030273 (1109, 43)-(1150, 93) batch id : 0
[10, 1] element, prob = 0.029297 (1151, 83)-(1190, 131) batch id : 0
[11, 1] element, prob = 0.027344 (1030, 2)-(1073, 43) batch id : 0
[12, 1] element, prob = 0.027344 (1091, 6)-(1133, 55) batch id : 0
[13, 1] element, prob = 0.027344 (1064, 73)-(1098, 121) batch id : 0
[14, 1] element, prob = 0.027344 (1058, 113)-(1096, 168) batch id : 0
[15, 1] element, prob = 0.027344 (1143, 74)-(1211, 165) batch id : 0
[16, 1] element, prob = 0.026855 (876, 73)-(915, 118) batch id : 0
[17, 1] element, prob = 0.026855 (1047, -3)-(1110, 59) batch id : 0
[18, 1] element, prob = 0.026855 (849, 13)-(1030, 236) batch id : 0
[19, 1] element, prob = 0.025879 (941, 22)-(981, 74) batch id : 0
[20, 1] element, prob = 0.025879 (1030, 35)-(1074, 89) batch id : 0
[21, 1] element, prob = 0.025879 (845, 112)-(886, 167) batch id : 0
[22, 1] element, prob = 0.025879 (1036, 111)-(1076, 171) batch id : 0
[23, 1] element, prob = 0.025879 (1113, -1)-(1175, 59) batch id : 0
[24, 1] element, prob = 0.025879 (1002, 40)-(1093, 151) batch id : 0
[25, 1] element, prob = 0.024902 (1059, 0)-(1098, 43) batch id : 0
[26, 1] element, prob = 0.024902 (876, 29)-(918, 79) batch id : 0
[27, 1] element, prob = 0.024902 (1002, 69)-(1048, 123) batch id : 0
[28, 1] element, prob = 0.024902 (1133, 104)-(1170, 163) batch id : 0
[29, 1] element, prob = 0.024902 (1056, 145)-(1094, 208) batch id : 0
[30, 1] element, prob = 0.024902 (861, 2)-(918, 63) batch id : 0
[31, 1] element, prob = 0.023926 (966, 1)-(1018, 45) batch id : 0
[32, 1] element, prob = 0.023926 (1098, 63)-(1131, 109) batch id : 0
[33, 1] element, prob = 0.023926 (1010, 84)-(1092, 204) batch id : 0
[34, 1] element, prob = 0.023926 (1022, 139)-(1076, 224) batch id : 0
[35, 1] element, prob = 0.023926 (943, 34)-(1073, 208) batch id : 0
[36, 1] element, prob = 0.022949 (811, 3)-(851, 48) batch id : 0
[37, 1] element, prob = 0.022949 (1154, 27)-(1198, 79) batch id : 0
[38, 1] element, prob = 0.022949 (1000, 155)-(1046, 226) batch id : 0
[39, 1] element, prob = 0.022949 (1086, 145)-(1125, 208) batch id : 0
[40, 1] element, prob = 0.022949 (958, 20)-(1030, 84) batch id : 0
[41, 1] element, prob = 0.022949 (934, 65)-(986, 155) batch id : 0
[42, 1] element, prob = 0.022949 (1045, 99)-(1106, 178) batch id : 0
[43, 1] element, prob = 0.022949 (983, -9)-(1141, 105) batch id : 0
[44, 1] element, prob = 0.022949 (1065, -16)-(1192, 124) batch id : 0
[45, 1] element, prob = 0.022949 (922, 81)-(1087, 304) batch id : 0
[46, 1] element, prob = 0.021973 (796, 3)-(834, 47) batch id : 0
[47, 1] element, prob = 0.021973 (911, 4)-(953, 55) batch id : 0
[48, 1] element, prob = 0.021973 (797, 29)-(835, 79) batch id : 0
[49, 1] element, prob = 0.021973 (821, 34)-(855, 81) batch id : 0
[50, 1] element, prob = 0.021973 (910, 28)-(945, 78) batch id : 0
[51, 1] element, prob = 0.021973 (755, 77)-(790, 125) batch id : 0
[52, 1] element, prob = 0.021973 (969, 80)-(1008, 128) batch id : 0
[53, 1] element, prob = 0.021973 (938, 108)-(980, 173) batch id : 0
[54, 1] element, prob = 0.021973 (1123, 186)-(1161, 252) batch id : 0
[55, 1] element, prob = 0.021973 (985, 28)-(1056, 105) batch id : 0
[56, 1] element, prob = 0.021973 (845, 56)-(898, 135) batch id : 0
[57, 1] element, prob = 0.021973 (1023, 62)-(1080, 131) batch id : 0
[58, 1] element, prob = 0.021973 (1041, 40)-(1125, 143) batch id : 0
[59, 1] element, prob = 0.021973 (1035, 116)-(1110, 242) batch id : 0
[60, 1] element, prob = 0.021973 (990, 166)-(1054, 269) batch id : 0
[61, 1] element, prob = 0.021973 (1078, 169)-(1130, 261) batch id : 0
[62, 1] element, prob = 0.021973 (971, 13)-(1140, 235) batch id : 0
[63, 1] element, prob = 0.021973 (980, 125)-(1108, 286) batch id : 0
[64, 1] element, prob = 0.020996 (940, 5)-(987, 55) batch id : 0
[65, 1] element, prob = 0.020996 (991, 0)-(1043, 41) batch id : 0
[66, 1] element, prob = 0.020996 (1126, 0)-(1165, 42) batch id : 0
[67, 1] element, prob = 0.020996 (998, 41)-(1039, 86) batch id : 0
[68, 1] element, prob = 0.020996 (1068, 40)-(1103, 86) batch id : 0
[69, 1] element, prob = 0.020996 (821, 77)-(856, 123) batch id : 0
[70, 1] element, prob = 0.020996 (913, 80)-(949, 128) batch id : 0
[71, 1] element, prob = 0.020996 (821, 112)-(861, 164) batch id : 0
[72, 1] element, prob = 0.020996 (878, 113)-(919, 175) batch id : 0
[73, 1] element, prob = 0.020996 (910, 110)-(950, 170) batch id : 0
[74, 1] element, prob = 0.020996 (1149, 111)-(1189, 163) batch id : 0
[75, 1] element, prob = 0.020996 (870, 149)-(918, 215) batch id : 0
[76, 1] element, prob = 0.020996 (1033, 152)-(1070, 209) batch id : 0
[77, 1] element, prob = 0.020996 (1128, 141)-(1165, 204) batch id : 0
[78, 1] element, prob = 0.020996 (1147, 135)-(1188, 199) batch id : 0
[79, 1] element, prob = 0.020996 (1064, 188)-(1099, 246) batch id : 0
[80, 1] element, prob = 0.020996 (1238, 903)-(1279, 963) batch id : 0
[81, 1] element, prob = 0.020996 (1146, 19)-(1208, 109) batch id : 0
[82, 1] element, prob = 0.020996 (1054, 58)-(1110, 126) batch id : 0
[83, 1] element, prob = 0.020996 (1111, 99)-(1190, 228) batch id : 0
[84, 1] element, prob = 0.020996 (1052, 161)-(1105, 265) batch id : 0
[85, 1] element, prob = 0.020996 (1060, 145)-(1139, 284) batch id : 0
[86, 1] element, prob = 0.020996 (-16, 860)-(79, 985) batch id : 0
[87, 1] element, prob = 0.020996 (1174, -17)-(1281, 136) batch id : 0
[88, 1] element, prob = 0.020996 (1073, 32)-(1198, 190) batch id : 0
[89, 1] element, prob = 0.020996 (950, 188)-(1072, 366) batch id : 0
[90, 1] element, prob = 0.020020 (943, 81)-(978, 130) batch id : 0
[91, 1] element, prob = 0.020020 (968, 104)-(1008, 159) batch id : 0
[92, 1] element, prob = 0.020020 (930, 148)-(973, 211) batch id : 0
[93, 1] element, prob = 0.020020 (1092, 191)-(1128, 246) batch id : 0
[94, 1] element, prob = 0.020020 (1124, 225)-(1161, 291) batch id : 0
[95, 1] element, prob = 0.020020 (1007, -2)-(1083, 55) batch id : 0
[96, 1] element, prob = 0.020020 (890, 60)-(960, 138) batch id : 0
[97, 1] element, prob = 0.020020 (962, 65)-(1023, 137) batch id : 0
[98, 1] element, prob = 0.020020 (1101, 145)-(1183, 284) batch id : 0
[99, 1] element, prob = 0.020020 (866, -10)-(1029, 107) batch id : 0
[100, 1] element, prob = 0.020020 (1005, 179)-(1111, 360) batch id : 0
[101, 1] element, prob = 0.020020 (1019, 342)-(1283, 785) batch id : 0
[102, 1] element, prob = 0.019043 (758, 2)-(795, 45) batch id : 0
[103, 1] element, prob = 0.019043 (756, 38)-(792, 89) batch id : 0
[104, 1] element, prob = 0.019043 (968, 36)-(1011, 82) batch id : 0
[105, 1] element, prob = 0.019043 (729, 77)-(763, 127) batch id : 0
[106, 1] element, prob = 0.019043 (1003, 109)-(1044, 169) batch id : 0
[107, 1] element, prob = 0.019043 (1030, 190)-(1066, 242) batch id : 0
[108, 1] element, prob = 0.019043 (887, 83)-(971, 209) batch id : 0
[109, 1] element, prob = 0.019043 (995, 99)-(1055, 192) batch id : 0
[110, 1] element, prob = 0.019043 (902, 135)-(963, 221) batch id : 0
[ INFO ] Image out_0.bmp created!
[ INFO ] Execution successful
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
➜  samples ./c/build/armv7l/Release/object_detection_sample_ssd_c -m face-detection-adas-0001.xml -d MYRIAD -i me.jpg     
[ INFO ] InferenceEngine:
2.1.2020.3.0-3467-15f2c61a-releases/2020/3
[ INFO ] Parsing input parameters
[ INFO ] Files were added: 1
[ INFO ] me.jpg
[ INFO ] Loading Inference Engine
[ INFO ] Device info:
MYRIAD
myriadPlugin version ......... 2.1
Build ......... 2020.3.0-3467-15f2c61a-releases/2020/3
[ INFO ] Loading network files:
face-detection-adas-0001.xml
face-detection-adas-0001.bin
[ INFO ] Preparing input blobs
[ WARNING ] Image is resized from (924, 1280) to (672, 384)
[ INFO ] Batch size is 1
[ INFO ] Preparing output blobs
[ INFO ] Loading model to the device
[ INFO ] Create infer request
[ INFO ] Start inference
[ INFO ] Processing output blobs
[0, 1] element, prob = 0.870117 (421, 202)-(745, 608) batch id : 0 WILL BE PRINTED!
[1, 1] element, prob = 0.026855 (-55, 556)-(234, 1100) batch id : 0
[2, 1] element, prob = 0.021973 (20, 925)-(239, 1340) batch id : 0
[3, 1] element, prob = 0.020020 (-18, -144)-(179, 581) batch id : 0
[4, 1] element, prob = 0.018066 (636, 315)-(757, 471) batch id : 0
[5, 1] element, prob = 0.017090 (-27, 672)-(137, 1217) batch id : 0
[6, 1] element, prob = 0.017090 (74, 976)-(364, 1322) batch id : 0
[7, 1] element, prob = 0.016113 (291, 958)-(349, 1122) batch id : 0
[8, 1] element, prob = 0.016113 (329, 963)-(391, 1126) batch id : 0
[9, 1] element, prob = 0.016113 (203, 928)-(423, 1346) batch id : 0
[10, 1] element, prob = 0.015625 (694, 1034)-(732, 1140) batch id : 0
[11, 1] element, prob = 0.015625 (832, 1121)-(937, 1295) batch id : 0
[12, 1] element, prob = 0.015625 (219, 39)-(388, 627) batch id : 0
[13, 1] element, prob = 0.015625 (76, 785)-(357, 1160) batch id : 0
[14, 1] element, prob = 0.014648 (355, 616)-(475, 778) batch id : 0
[15, 1] element, prob = 0.014648 (240, 779)-(331, 1048) batch id : 0
[16, 1] element, prob = 0.013672 (0, 893)-(24, 984) batch id : 0
[17, 1] element, prob = 0.013672 (658, 306)-(752, 405) batch id : 0
[18, 1] element, prob = 0.013672 (204, 1198)-(267, 1275) batch id : 0
[19, 1] element, prob = 0.013672 (322, 611)-(430, 794) batch id : 0
[20, 1] element, prob = 0.013672 (171, 244)-(423, 798) batch id : 0
[21, 1] element, prob = 0.013672 (252, 798)-(539, 1177) batch id : 0
[22, 1] element, prob = 0.013672 (133, 875)-(301, 1420) batch id : 0
[23, 1] element, prob = 0.013672 (443, 202)-(802, 1022) batch id : 0
[24, 1] element, prob = 0.012695 (718, 466)-(757, 540) batch id : 0
[25, 1] element, prob = 0.012695 (166, 527)-(206, 594) batch id : 0
[26, 1] element, prob = 0.012695 (694, 511)-(731, 590) batch id : 0
[27, 1] element, prob = 0.012695 (705, 441)-(771, 555) batch id : 0
[28, 1] element, prob = 0.012695 (272, 962)-(322, 1117) batch id : 0
[29, 1] element, prob = 0.012695 (268, 486)-(376, 688) batch id : 0
[30, 1] element, prob = 0.012695 (323, 489)-(422, 690) batch id : 0
[31, 1] element, prob = 0.012695 (277, 607)-(384, 796) batch id : 0
[32, 1] element, prob = 0.012695 (233, 709)-(342, 924) batch id : 0
[33, 1] element, prob = 0.012695 (256, 672)-(406, 957) batch id : 0
[34, 1] element, prob = 0.012695 (252, 1043)-(431, 1214) batch id : 0
[35, 1] element, prob = 0.011719 (695, 466)-(733, 539) batch id : 0
[36, 1] element, prob = 0.011719 (673, 514)-(709, 587) batch id : 0
[37, 1] element, prob = 0.011719 (370, 1005)-(399, 1078) batch id : 0
[38, 1] element, prob = 0.011719 (670, 256)-(753, 346) batch id : 0
[39, 1] element, prob = 0.011719 (151, 500)-(221, 610) batch id : 0
[40, 1] element, prob = 0.011719 (447, 489)-(511, 608) batch id : 0
[41, 1] element, prob = 0.011719 (126, 625)-(200, 719) batch id : 0
[42, 1] element, prob = 0.011719 (299, 626)-(387, 709) batch id : 0
[43, 1] element, prob = 0.011719 (164, 673)-(251, 747) batch id : 0
[44, 1] element, prob = 0.011719 (398, 850)-(453, 1008) batch id : 0
[45, 1] element, prob = 0.011719 (425, 851)-(476, 1008) batch id : 0
[46, 1] element, prob = 0.011719 (310, 915)-(371, 1077) batch id : 0
[47, 1] element, prob = 0.011719 (357, 925)-(413, 1073) batch id : 0
[48, 1] element, prob = 0.011719 (378, 923)-(435, 1074) batch id : 0
[49, 1] element, prob = 0.011719 (468, 906)-(521, 1070) batch id : 0
[50, 1] element, prob = 0.011719 (284, 1016)-(357, 1188) batch id : 0
[51, 1] element, prob = 0.011719 (203, -95)-(283, 182) batch id : 0
[52, 1] element, prob = 0.011719 (269, 378)-(374, 595) batch id : 0
[53, 1] element, prob = 0.011719 (-22, 575)-(71, 831) batch id : 0
[54, 1] element, prob = 0.011719 (318, 698)-(433, 911) batch id : 0
[55, 1] element, prob = 0.011719 (221, 716)-(395, 1258) batch id : 0
[56, 1] element, prob = 0.011719 (859, 771)-(987, 1518) batch id : 0
[57, 1] element, prob = 0.010742 (145, 466)-(185, 527) batch id : 0
[58, 1] element, prob = 0.010742 (166, 463)-(204, 521) batch id : 0
[59, 1] element, prob = 0.010742 (185, 477)-(224, 537) batch id : 0
[60, 1] element, prob = 0.010742 (214, 477)-(250, 540) batch id : 0
[61, 1] element, prob = 0.010742 (458, 478)-(488, 536) batch id : 0
[62, 1] element, prob = 0.010742 (151, 537)-(177, 594) batch id : 0
[63, 1] element, prob = 0.010742 (460, 522)-(488, 590) batch id : 0
[64, 1] element, prob = 0.010742 (481, 523)-(509, 588) batch id : 0
[65, 1] element, prob = 0.010742 (716, 512)-(755, 592) batch id : 0
[66, 1] element, prob = 0.010742 (129, 581)-(158, 641) batch id : 0
[67, 1] element, prob = 0.010742 (150, 579)-(179, 635) batch id : 0
[68, 1] element, prob = 0.010742 (171, 583)-(201, 641) batch id : 0
[69, 1] element, prob = 0.010742 (457, 564)-(491, 658) batch id : 0
[70, 1] element, prob = 0.010742 (481, 581)-(510, 647) batch id : 0
[71, 1] element, prob = 0.010742 (652, 565)-(689, 650) batch id : 0
[72, 1] element, prob = 0.010742 (674, 571)-(710, 650) batch id : 0
[73, 1] element, prob = 0.010742 (694, 571)-(734, 649) batch id : 0
[74, 1] element, prob = 0.010742 (143, 640)-(188, 705) batch id : 0
[75, 1] element, prob = 0.010742 (191, 743)-(224, 805) batch id : 0
[76, 1] element, prob = 0.010742 (437, 843)-(465, 920) batch id : 0
[77, 1] element, prob = 0.010742 (-1, 943)-(22, 1037) batch id : 0
[78, 1] element, prob = 0.010742 (414, 1007)-(443, 1080) batch id : 0
[79, 1] element, prob = 0.010742 (896, 1206)-(924, 1279) batch id : 0
[80, 1] element, prob = 0.010742 (678, 200)-(743, 294) batch id : 0
[81, 1] element, prob = 0.010742 (70, 374)-(190, 512) batch id : 0
[82, 1] element, prob = 0.010742 (422, 429)-(485, 563) batch id : 0
[83, 1] element, prob = 0.010742 (106, 477)-(213, 629) batch id : 0
[84, 1] element, prob = 0.010742 (428, 477)-(479, 615) batch id : 0
[85, 1] element, prob = 0.010742 (648, 498)-(727, 605) batch id : 0
[86, 1] element, prob = 0.010742 (703, 490)-(769, 614) batch id : 0
[87, 1] element, prob = 0.010742 (16, 531)-(150, 712) batch id : 0
[88, 1] element, prob = 0.010742 (87, 546)-(150, 685) batch id : 0
[89, 1] element, prob = 0.010742 (127, 552)-(197, 653) batch id : 0
[90, 1] element, prob = 0.010742 (425, 557)-(481, 671) batch id : 0
[91, 1] element, prob = 0.010742 (437, 509)-(516, 700) batch id : 0
[92, 1] element, prob = 0.010742 (467, 549)-(524, 678) batch id : 0
[93, 1] element, prob = 0.010742 (633, 551)-(704, 664) batch id : 0
[94, 1] element, prob = 0.010742 (416, 611)-(487, 735) batch id : 0
[95, 1] element, prob = 0.010742 (466, 602)-(530, 734) batch id : 0
[96, 1] element, prob = 0.010742 (124, 673)-(198, 759) batch id : 0
[97, 1] element, prob = 0.010742 (156, 705)-(260, 849) batch id : 0
[98, 1] element, prob = 0.010742 (54, 828)-(137, 933) batch id : 0
[99, 1] element, prob = 0.010742 (451, 812)-(498, 960) batch id : 0
[100, 1] element, prob = 0.010742 (470, 843)-(520, 1004) batch id : 0
[101, 1] element, prob = 0.010742 (447, 897)-(500, 1066) batch id : 0
[102, 1] element, prob = 0.010742 (641, 966)-(706, 1122) batch id : 0
[103, 1] element, prob = 0.010742 (164, 85)-(233, 410) batch id : 0
[104, 1] element, prob = 0.010742 (188, 497)-(307, 688) batch id : 0
[105, 1] element, prob = 0.010742 (205, 445)-(357, 715) batch id : 0
[106, 1] element, prob = 0.010742 (230, 602)-(341, 791) batch id : 0
[107, 1] element, prob = 0.010742 (274, 785)-(390, 1021) batch id : 0
[108, 1] element, prob = 0.010742 (26, 709)-(209, 1239) batch id : 0
[109, 1] element, prob = 0.010742 (309, 868)-(485, 1410) batch id : 0
[110, 1] element, prob = 0.010742 (229, 981)-(575, 1306) batch id : 0
[111, 1] element, prob = 0.010742 (29, 141)-(518, 883) batch id : 0
[ INFO ] Image out_0.bmp created!
[ INFO ] Execution successful

For NCS 1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
➜  samples pwd
/opt/intel/openvino/inference_engine/samples
➜ samples ./c/build/armv7l/Release/object_detection_sample_ssd_c -m face-detection-adas-0001.xml -d MYRIAD -i parents.jpg
[ INFO ] InferenceEngine:
2.1.2020.3.0-3467-15f2c61a-releases/2020/3
[ INFO ] Parsing input parameters
[ INFO ] Files were added: 1
[ INFO ] parents.jpg
[ INFO ] Loading Inference Engine
[ INFO ] Device info:
MYRIAD
myriadPlugin version ......... 2.1
Build ......... 2020.3.0-3467-15f2c61a-releases/2020/3
[ INFO ] Loading network files:
face-detection-adas-0001.xml
face-detection-adas-0001.bin
[ INFO ] Preparing input blobs
[ WARNING ] Image is resized from (1280, 960) to (672, 384)
[ INFO ] Batch size is 1
[ INFO ] Preparing output blobs
[ INFO ] Loading model to the device
[ INFO ] Create infer request
[ INFO ] Start inference
[ INFO ] Processing output blobs
[0, 1] element, prob = 1.000000 (826, 366)-(1026, 644) batch id : 0 WILL BE PRINTED!
[1, 1] element, prob = 0.996582 (539, 173)-(693, 429) batch id : 0 WILL BE PRINTED!
[2, 1] element, prob = 0.552734 (1094, 47)-(1135, 95) batch id : 0 WILL BE PRINTED!
[3, 1] element, prob = 0.221680 (848, 22)-(886, 70) batch id : 0
[4, 1] element, prob = 0.053711 (8, 784)-(151, 956) batch id : 0
[5, 1] element, prob = 0.039551 (1033, 78)-(1070, 122) batch id : 0
[6, 1] element, prob = 0.034668 (1123, 75)-(1158, 122) batch id : 0
[7, 1] element, prob = 0.032227 (1086, 14)-(1138, 85) batch id : 0
[8, 1] element, prob = 0.031250 (1091, 110)-(1130, 171) batch id : 0
[9, 1] element, prob = 0.030273 (1108, 43)-(1150, 93) batch id : 0
[10, 1] element, prob = 0.029297 (1151, 83)-(1190, 131) batch id : 0
[11, 1] element, prob = 0.027344 (1091, 6)-(1133, 55) batch id : 0
[12, 1] element, prob = 0.027344 (1064, 73)-(1098, 121) batch id : 0
[13, 1] element, prob = 0.026855 (1030, 2)-(1073, 42) batch id : 0
[14, 1] element, prob = 0.026855 (1058, 113)-(1096, 168) batch id : 0
[15, 1] element, prob = 0.026855 (1047, -3)-(1110, 59) batch id : 0
[16, 1] element, prob = 0.026855 (1142, 75)-(1211, 165) batch id : 0
[17, 1] element, prob = 0.026855 (849, 14)-(1030, 236) batch id : 0
[18, 1] element, prob = 0.025879 (941, 22)-(981, 74) batch id : 0
[19, 1] element, prob = 0.025879 (1030, 36)-(1074, 89) batch id : 0
[20, 1] element, prob = 0.025879 (876, 73)-(915, 118) batch id : 0
[21, 1] element, prob = 0.025879 (845, 112)-(886, 167) batch id : 0
[22, 1] element, prob = 0.025879 (1036, 110)-(1076, 171) batch id : 0
[23, 1] element, prob = 0.025879 (1113, -1)-(1175, 59) batch id : 0
[24, 1] element, prob = 0.025879 (1003, 41)-(1094, 151) batch id : 0
[25, 1] element, prob = 0.024902 (1059, 0)-(1098, 43) batch id : 0
[26, 1] element, prob = 0.024902 (1002, 69)-(1048, 123) batch id : 0
[27, 1] element, prob = 0.024902 (1133, 105)-(1170, 164) batch id : 0
[28, 1] element, prob = 0.023926 (966, 1)-(1018, 45) batch id : 0
[29, 1] element, prob = 0.023926 (876, 29)-(918, 79) batch id : 0
[30, 1] element, prob = 0.023926 (1056, 145)-(1094, 208) batch id : 0
[31, 1] element, prob = 0.023926 (861, 2)-(918, 63) batch id : 0
[32, 1] element, prob = 0.023926 (1010, 84)-(1092, 204) batch id : 0
[33, 1] element, prob = 0.023926 (1022, 139)-(1076, 224) batch id : 0
[34, 1] element, prob = 0.023926 (942, 35)-(1072, 208) batch id : 0
[35, 1] element, prob = 0.022949 (811, 3)-(851, 48) batch id : 0
[36, 1] element, prob = 0.022949 (1098, 63)-(1131, 109) batch id : 0
[37, 1] element, prob = 0.022949 (983, -9)-(1141, 105) batch id : 0
[38, 1] element, prob = 0.022949 (921, 81)-(1087, 304) batch id : 0
[39, 1] element, prob = 0.021973 (796, 3)-(835, 47) batch id : 0
[40, 1] element, prob = 0.021973 (911, 4)-(953, 55) batch id : 0
[41, 1] element, prob = 0.021973 (797, 29)-(835, 79) batch id : 0
[42, 1] element, prob = 0.021973 (1154, 27)-(1198, 79) batch id : 0
[43, 1] element, prob = 0.021973 (969, 80)-(1008, 128) batch id : 0
[44, 1] element, prob = 0.021973 (1000, 155)-(1046, 226) batch id : 0
[45, 1] element, prob = 0.021973 (1086, 145)-(1125, 208) batch id : 0
[46, 1] element, prob = 0.021973 (1123, 186)-(1161, 252) batch id : 0
[47, 1] element, prob = 0.021973 (958, 20)-(1030, 84) batch id : 0
[48, 1] element, prob = 0.021973 (985, 28)-(1056, 105) batch id : 0
[49, 1] element, prob = 0.021973 (845, 56)-(898, 134) batch id : 0
[50, 1] element, prob = 0.021973 (934, 65)-(986, 155) batch id : 0
[51, 1] element, prob = 0.021973 (1046, 99)-(1107, 178) batch id : 0
[52, 1] element, prob = 0.021973 (1035, 116)-(1110, 241) batch id : 0
[53, 1] element, prob = 0.021973 (990, 166)-(1054, 269) batch id : 0
[54, 1] element, prob = 0.021973 (1065, -16)-(1192, 124) batch id : 0
[55, 1] element, prob = 0.021973 (971, 13)-(1140, 235) batch id : 0
[56, 1] element, prob = 0.021973 (980, 125)-(1108, 286) batch id : 0
[57, 1] element, prob = 0.020996 (991, 0)-(1043, 41) batch id : 0
[58, 1] element, prob = 0.020996 (1126, 0)-(1165, 42) batch id : 0
[59, 1] element, prob = 0.020996 (821, 35)-(856, 79) batch id : 0
[60, 1] element, prob = 0.020996 (910, 28)-(945, 78) batch id : 0
[61, 1] element, prob = 0.020996 (997, 41)-(1038, 86) batch id : 0
[62, 1] element, prob = 0.020996 (1068, 40)-(1103, 86) batch id : 0
[63, 1] element, prob = 0.020996 (754, 77)-(789, 125) batch id : 0
[64, 1] element, prob = 0.020996 (819, 77)-(855, 123) batch id : 0
[65, 1] element, prob = 0.020996 (913, 79)-(949, 128) batch id : 0
[66, 1] element, prob = 0.020996 (821, 112)-(861, 164) batch id : 0
[67, 1] element, prob = 0.020996 (938, 108)-(980, 173) batch id : 0
[68, 1] element, prob = 0.020996 (1149, 112)-(1189, 162) batch id : 0
[69, 1] element, prob = 0.020996 (870, 149)-(918, 215) batch id : 0
[70, 1] element, prob = 0.020996 (1033, 152)-(1070, 209) batch id : 0
[71, 1] element, prob = 0.020996 (1064, 188)-(1099, 246) batch id : 0
[72, 1] element, prob = 0.020996 (1023, 63)-(1081, 131) batch id : 0
[73, 1] element, prob = 0.020996 (1054, 58)-(1110, 126) batch id : 0
[74, 1] element, prob = 0.020996 (1041, 40)-(1125, 143) batch id : 0
[75, 1] element, prob = 0.020996 (1111, 99)-(1190, 228) batch id : 0
[76, 1] element, prob = 0.020996 (1078, 169)-(1130, 261) batch id : 0
[77, 1] element, prob = 0.020996 (950, 189)-(1072, 367) batch id : 0
[78, 1] element, prob = 0.020020 (940, 6)-(987, 56) batch id : 0
[79, 1] element, prob = 0.020020 (943, 81)-(978, 130) batch id : 0
[80, 1] element, prob = 0.020020 (878, 114)-(919, 175) batch id : 0
[81, 1] element, prob = 0.020020 (910, 110)-(950, 170) batch id : 0
[82, 1] element, prob = 0.020020 (968, 104)-(1008, 159) batch id : 0
[83, 1] element, prob = 0.020020 (1128, 141)-(1165, 204) batch id : 0
[84, 1] element, prob = 0.020020 (1147, 135)-(1188, 199) batch id : 0
[85, 1] element, prob = 0.020020 (1238, 903)-(1279, 963) batch id : 0
[86, 1] element, prob = 0.020020 (1007, -2)-(1083, 55) batch id : 0
[87, 1] element, prob = 0.020020 (1052, 161)-(1105, 266) batch id : 0
[88, 1] element, prob = 0.020020 (1061, 145)-(1140, 284) batch id : 0
[89, 1] element, prob = 0.020020 (-16, 860)-(79, 985) batch id : 0
[90, 1] element, prob = 0.020020 (866, -10)-(1029, 107) batch id : 0
[91, 1] element, prob = 0.020020 (1173, -17)-(1280, 136) batch id : 0
[92, 1] element, prob = 0.020020 (1072, 32)-(1197, 189) batch id : 0
[93, 1] element, prob = 0.020020 (1005, 179)-(1111, 359) batch id : 0
[94, 1] element, prob = 0.019043 (758, 2)-(795, 45) batch id : 0
[95, 1] element, prob = 0.019043 (968, 35)-(1011, 82) batch id : 0
[96, 1] element, prob = 0.019043 (1003, 109)-(1044, 169) batch id : 0
[97, 1] element, prob = 0.019043 (930, 148)-(973, 211) batch id : 0
[98, 1] element, prob = 0.019043 (1092, 191)-(1128, 246) batch id : 0
[99, 1] element, prob = 0.019043 (1123, 225)-(1161, 291) batch id : 0
[100, 1] element, prob = 0.019043 (1146, 19)-(1208, 109) batch id : 0
[101, 1] element, prob = 0.019043 (897, 59)-(958, 143) batch id : 0
[102, 1] element, prob = 0.019043 (962, 65)-(1023, 137) batch id : 0
[103, 1] element, prob = 0.019043 (886, 83)-(971, 209) batch id : 0
[104, 1] element, prob = 0.019043 (995, 99)-(1055, 192) batch id : 0
[105, 1] element, prob = 0.019043 (902, 135)-(963, 221) batch id : 0
[106, 1] element, prob = 0.019043 (1101, 145)-(1183, 284) batch id : 0
[107, 1] element, prob = 0.019043 (821, -17)-(946, 129) batch id : 0
[108, 1] element, prob = 0.019043 (940, -16)-(1076, 120) batch id : 0
[109, 1] element, prob = 0.019043 (819, 34)-(945, 205) batch id : 0
[110, 1] element, prob = 0.019043 (1019, 342)-(1283, 785) batch id : 0
[111, 1] element, prob = 0.018066 (1147, 7)-(1193, 54) batch id : 0
[112, 1] element, prob = 0.018066 (756, 38)-(792, 89) batch id : 0
[ INFO ] Image out_0.bmp created!
[ INFO ] Execution successful
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
➜  samples ./c/build/armv7l/Release/object_detection_sample_ssd_c -m face-detection-adas-0001.xml -d MYRIAD -i me.jpg     
[ INFO ] InferenceEngine:
2.1.2020.3.0-3467-15f2c61a-releases/2020/3
[ INFO ] Parsing input parameters
[ INFO ] Files were added: 1
[ INFO ] me.jpg
[ INFO ] Loading Inference Engine
[ INFO ] Device info:
MYRIAD
myriadPlugin version ......... 2.1
Build ......... 2020.3.0-3467-15f2c61a-releases/2020/3
[ INFO ] Loading network files:
face-detection-adas-0001.xml
face-detection-adas-0001.bin
[ INFO ] Preparing input blobs
[ WARNING ] Image is resized from (924, 1280) to (672, 384)
[ INFO ] Batch size is 1
[ INFO ] Preparing output blobs
[ INFO ] Loading model to the device
[ INFO ] Create infer request
[ INFO ] Start inference
[ INFO ] Processing output blobs
[0, 1] element, prob = 0.871094 (420, 202)-(745, 608) batch id : 0 WILL BE PRINTED!
[1, 1] element, prob = 0.026855 (-54, 555)-(234, 1100) batch id : 0
[2, 1] element, prob = 0.020996 (21, 925)-(239, 1340) batch id : 0
[3, 1] element, prob = 0.019043 (-18, -144)-(178, 583) batch id : 0
[4, 1] element, prob = 0.018066 (636, 315)-(757, 470) batch id : 0
[5, 1] element, prob = 0.017090 (75, 977)-(363, 1321) batch id : 0
[6, 1] element, prob = 0.016113 (291, 958)-(349, 1123) batch id : 0
[7, 1] element, prob = 0.015625 (329, 962)-(391, 1126) batch id : 0
[8, 1] element, prob = 0.015625 (832, 1121)-(937, 1293) batch id : 0
[9, 1] element, prob = 0.015625 (-27, 670)-(136, 1220) batch id : 0
[10, 1] element, prob = 0.015625 (76, 785)-(357, 1160) batch id : 0
[11, 1] element, prob = 0.015625 (204, 928)-(423, 1346) batch id : 0
[12, 1] element, prob = 0.014648 (694, 1035)-(732, 1141) batch id : 0
[13, 1] element, prob = 0.014648 (219, 40)-(388, 626) batch id : 0
[14, 1] element, prob = 0.013672 (658, 306)-(752, 405) batch id : 0
[15, 1] element, prob = 0.013672 (204, 1198)-(267, 1275) batch id : 0
[16, 1] element, prob = 0.013672 (322, 612)-(430, 793) batch id : 0
[17, 1] element, prob = 0.013672 (240, 779)-(331, 1046) batch id : 0
[18, 1] element, prob = 0.013672 (171, 245)-(424, 798) batch id : 0
[19, 1] element, prob = 0.013672 (443, 205)-(802, 1021) batch id : 0
[20, 1] element, prob = 0.012695 (694, 511)-(731, 590) batch id : 0
[21, 1] element, prob = 0.012695 (0, 893)-(24, 984) batch id : 0
[22, 1] element, prob = 0.012695 (272, 962)-(322, 1117) batch id : 0
[23, 1] element, prob = 0.012695 (268, 487)-(376, 688) batch id : 0
[24, 1] element, prob = 0.012695 (323, 490)-(422, 690) batch id : 0
[25, 1] element, prob = 0.012695 (277, 608)-(384, 795) batch id : 0
[26, 1] element, prob = 0.012695 (233, 710)-(342, 923) batch id : 0
[27, 1] element, prob = 0.012695 (256, 672)-(406, 957) batch id : 0
[28, 1] element, prob = 0.012695 (252, 799)-(540, 1176) batch id : 0
[29, 1] element, prob = 0.012695 (133, 876)-(301, 1420) batch id : 0
[30, 1] element, prob = 0.011719 (718, 466)-(757, 540) batch id : 0
[31, 1] element, prob = 0.011719 (166, 527)-(206, 594) batch id : 0
[32, 1] element, prob = 0.011719 (673, 514)-(709, 587) batch id : 0
[33, 1] element, prob = 0.011719 (-1, 943)-(22, 1038) batch id : 0
[34, 1] element, prob = 0.011719 (670, 256)-(753, 346) batch id : 0
[35, 1] element, prob = 0.011719 (705, 441)-(771, 555) batch id : 0
[36, 1] element, prob = 0.011719 (126, 625)-(200, 718) batch id : 0
[37, 1] element, prob = 0.011719 (164, 673)-(251, 747) batch id : 0
[38, 1] element, prob = 0.011719 (399, 850)-(453, 1008) batch id : 0
[39, 1] element, prob = 0.011719 (424, 851)-(476, 1009) batch id : 0
[40, 1] element, prob = 0.011719 (357, 925)-(413, 1073) batch id : 0
[41, 1] element, prob = 0.011719 (399, 919)-(454, 1074) batch id : 0
[42, 1] element, prob = 0.011719 (468, 906)-(521, 1070) batch id : 0
[43, 1] element, prob = 0.011719 (284, 1016)-(357, 1186) batch id : 0
[44, 1] element, prob = 0.011719 (269, 379)-(374, 595) batch id : 0
[45, 1] element, prob = 0.011719 (349, 563)-(485, 831) batch id : 0
[46, 1] element, prob = 0.011719 (252, 1042)-(431, 1215) batch id : 0
[47, 1] element, prob = 0.011719 (858, 771)-(987, 1518) batch id : 0
[48, 1] element, prob = 0.010742 (165, 463)-(204, 521) batch id : 0
[49, 1] element, prob = 0.010742 (185, 477)-(224, 537) batch id : 0
[50, 1] element, prob = 0.010742 (214, 477)-(250, 540) batch id : 0
[51, 1] element, prob = 0.010742 (458, 478)-(488, 536) batch id : 0
[52, 1] element, prob = 0.010742 (695, 466)-(733, 539) batch id : 0
[53, 1] element, prob = 0.010742 (460, 522)-(488, 590) batch id : 0
[54, 1] element, prob = 0.010742 (481, 523)-(509, 588) batch id : 0
[55, 1] element, prob = 0.010742 (716, 512)-(755, 592) batch id : 0
[56, 1] element, prob = 0.010742 (150, 579)-(179, 635) batch id : 0
[57, 1] element, prob = 0.010742 (171, 584)-(201, 641) batch id : 0
[58, 1] element, prob = 0.010742 (481, 582)-(510, 647) batch id : 0
[59, 1] element, prob = 0.010742 (652, 565)-(689, 650) batch id : 0
[60, 1] element, prob = 0.010742 (674, 571)-(710, 650) batch id : 0
[61, 1] element, prob = 0.010742 (694, 571)-(734, 648) batch id : 0
[62, 1] element, prob = 0.010742 (142, 640)-(188, 705) batch id : 0
[63, 1] element, prob = 0.010742 (335, 627)-(390, 695) batch id : 0
[64, 1] element, prob = 0.010742 (191, 744)-(225, 803) batch id : 0
[65, 1] element, prob = 0.010742 (370, 1005)-(399, 1078) batch id : 0
[66, 1] element, prob = 0.010742 (414, 1006)-(443, 1079) batch id : 0
[67, 1] element, prob = 0.010742 (896, 1207)-(924, 1280) batch id : 0
[68, 1] element, prob = 0.010742 (86, 386)-(160, 513) batch id : 0
[69, 1] element, prob = 0.010742 (106, 477)-(214, 630) batch id : 0
[70, 1] element, prob = 0.010742 (151, 501)-(221, 610) batch id : 0
[71, 1] element, prob = 0.010742 (428, 478)-(479, 615) batch id : 0
[72, 1] element, prob = 0.010742 (450, 478)-(506, 611) batch id : 0
[73, 1] element, prob = 0.010742 (647, 498)-(728, 605) batch id : 0
[74, 1] element, prob = 0.010742 (148, 556)-(220, 658) batch id : 0
[75, 1] element, prob = 0.010742 (425, 557)-(481, 671) batch id : 0
[76, 1] element, prob = 0.010742 (437, 510)-(516, 700) batch id : 0
[77, 1] element, prob = 0.010742 (463, 554)-(527, 674) batch id : 0
[78, 1] element, prob = 0.010742 (633, 551)-(704, 664) batch id : 0
[79, 1] element, prob = 0.010742 (280, 628)-(367, 711) batch id : 0
[80, 1] element, prob = 0.010742 (416, 612)-(488, 735) batch id : 0
[81, 1] element, prob = 0.010742 (155, 706)-(260, 850) batch id : 0
[82, 1] element, prob = 0.010742 (55, 828)-(137, 932) batch id : 0
[83, 1] element, prob = 0.010742 (451, 813)-(498, 960) batch id : 0
[84, 1] element, prob = 0.010742 (310, 914)-(371, 1076) batch id : 0
[85, 1] element, prob = 0.010742 (447, 896)-(500, 1065) batch id : 0
[86, 1] element, prob = 0.010742 (641, 966)-(706, 1121) batch id : 0
[87, 1] element, prob = 0.010742 (203, -95)-(283, 182) batch id : 0
[88, 1] element, prob = 0.010742 (164, 86)-(233, 410) batch id : 0
[89, 1] element, prob = 0.010742 (188, 498)-(307, 688) batch id : 0
[90, 1] element, prob = 0.010742 (205, 445)-(357, 715) batch id : 0
[91, 1] element, prob = 0.010742 (-22, 576)-(71, 832) batch id : 0
[92, 1] element, prob = 0.010742 (230, 603)-(342, 791) batch id : 0
[93, 1] element, prob = 0.010742 (318, 698)-(433, 909) batch id : 0
[94, 1] element, prob = 0.010742 (273, 784)-(390, 1021) batch id : 0
[95, 1] element, prob = 0.010742 (175, 740)-(444, 1237) batch id : 0
[ INFO ] Image out_0.bmp created!
[ INFO ] Execution successful

3.3.2 C++

For NCS 2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
➜  samples ./cpp/build/armv7l/Release/object_detection_sample_ssd -m face-detection-adas-0001.xml -d MYRIAD -i me.jpg 
[ INFO ] InferenceEngine:
API version ............ 2.1
Build .................. 2020.3.0-3467-15f2c61a-releases/2020/3
Description ....... API
Parsing input parameters
[ INFO ] Files were added: 1
[ INFO ] me.jpg
[ INFO ] Loading Inference Engine
[ INFO ] Device info:
MYRIAD
myriadPlugin version ......... 2.1
Build ........... 2020.3.0-3467-15f2c61a-releases/2020/3
[ INFO ] Loading network files:
face-detection-adas-0001.xml
face-detection-adas-0001.bin
[ INFO ] Preparing input blobs
[ INFO ] Batch size is 1
[ INFO ] Preparing output blobs
[ INFO ] Loading model to the device
[ INFO ] Create infer request
[ WARNING ] Image is resized from (924, 1280) to (672, 384)
[ INFO ] Batch size is 1
[ INFO ] Start inference
[ INFO ] Processing output blobs
[0,1] element, prob = 0.870117 (421,202)-(745,608) batch id : 0 WILL BE PRINTED!
[1,1] element, prob = 0.0268555 (-55,556)-(234,1100) batch id : 0
[2,1] element, prob = 0.0219727 (20,925)-(239,1340) batch id : 0
[3,1] element, prob = 0.0200195 (-18,-144)-(179,581) batch id : 0
[4,1] element, prob = 0.0180664 (636,315)-(757,471) batch id : 0
[5,1] element, prob = 0.0170898 (-27,672)-(137,1217) batch id : 0
[6,1] element, prob = 0.0170898 (74,976)-(364,1322) batch id : 0
[7,1] element, prob = 0.0161133 (291,958)-(349,1122) batch id : 0
[8,1] element, prob = 0.0161133 (329,963)-(391,1126) batch id : 0
[9,1] element, prob = 0.0161133 (203,928)-(423,1346) batch id : 0
[10,1] element, prob = 0.015625 (694,1034)-(732,1140) batch id : 0
[11,1] element, prob = 0.015625 (832,1121)-(937,1295) batch id : 0
[12,1] element, prob = 0.015625 (219,39)-(388,627) batch id : 0
[13,1] element, prob = 0.015625 (76,785)-(357,1160) batch id : 0
[14,1] element, prob = 0.0146484 (355,616)-(475,778) batch id : 0
[15,1] element, prob = 0.0146484 (240,779)-(331,1048) batch id : 0
[16,1] element, prob = 0.0136719 (0,893)-(24,984) batch id : 0
[17,1] element, prob = 0.0136719 (658,306)-(752,405) batch id : 0
[18,1] element, prob = 0.0136719 (204,1198)-(267,1275) batch id : 0
[19,1] element, prob = 0.0136719 (322,611)-(430,794) batch id : 0
[20,1] element, prob = 0.0136719 (171,244)-(423,798) batch id : 0
[21,1] element, prob = 0.0136719 (252,798)-(539,1177) batch id : 0
[22,1] element, prob = 0.0136719 (133,875)-(301,1420) batch id : 0
[23,1] element, prob = 0.0136719 (443,202)-(802,1022) batch id : 0
[24,1] element, prob = 0.0126953 (718,466)-(757,540) batch id : 0
[25,1] element, prob = 0.0126953 (166,527)-(206,594) batch id : 0
[26,1] element, prob = 0.0126953 (694,511)-(731,590) batch id : 0
[27,1] element, prob = 0.0126953 (705,441)-(771,555) batch id : 0
[28,1] element, prob = 0.0126953 (272,962)-(322,1117) batch id : 0
[29,1] element, prob = 0.0126953 (268,486)-(376,688) batch id : 0
[30,1] element, prob = 0.0126953 (323,489)-(422,690) batch id : 0
[31,1] element, prob = 0.0126953 (277,607)-(384,796) batch id : 0
[32,1] element, prob = 0.0126953 (233,709)-(342,924) batch id : 0
[33,1] element, prob = 0.0126953 (256,672)-(406,957) batch id : 0
[34,1] element, prob = 0.0126953 (252,1043)-(431,1214) batch id : 0
[35,1] element, prob = 0.0117188 (695,466)-(733,539) batch id : 0
[36,1] element, prob = 0.0117188 (673,514)-(709,587) batch id : 0
[37,1] element, prob = 0.0117188 (370,1005)-(399,1078) batch id : 0
[38,1] element, prob = 0.0117188 (670,256)-(753,346) batch id : 0
[39,1] element, prob = 0.0117188 (151,500)-(221,610) batch id : 0
[40,1] element, prob = 0.0117188 (447,489)-(511,608) batch id : 0
[41,1] element, prob = 0.0117188 (126,625)-(200,719) batch id : 0
[42,1] element, prob = 0.0117188 (299,626)-(387,709) batch id : 0
[43,1] element, prob = 0.0117188 (164,673)-(251,747) batch id : 0
[44,1] element, prob = 0.0117188 (398,850)-(453,1008) batch id : 0
[45,1] element, prob = 0.0117188 (425,851)-(476,1008) batch id : 0
[46,1] element, prob = 0.0117188 (310,915)-(371,1077) batch id : 0
[47,1] element, prob = 0.0117188 (357,925)-(413,1073) batch id : 0
[48,1] element, prob = 0.0117188 (378,923)-(435,1074) batch id : 0
[49,1] element, prob = 0.0117188 (468,906)-(521,1070) batch id : 0
[50,1] element, prob = 0.0117188 (284,1016)-(357,1188) batch id : 0
[51,1] element, prob = 0.0117188 (203,-95)-(283,182) batch id : 0
[52,1] element, prob = 0.0117188 (269,378)-(374,595) batch id : 0
[53,1] element, prob = 0.0117188 (-22,575)-(71,831) batch id : 0
[54,1] element, prob = 0.0117188 (318,698)-(433,911) batch id : 0
[55,1] element, prob = 0.0117188 (221,716)-(395,1258) batch id : 0
[56,1] element, prob = 0.0117188 (859,771)-(987,1518) batch id : 0
[57,1] element, prob = 0.0107422 (145,466)-(185,527) batch id : 0
[58,1] element, prob = 0.0107422 (166,463)-(204,521) batch id : 0
[59,1] element, prob = 0.0107422 (185,477)-(224,537) batch id : 0
[60,1] element, prob = 0.0107422 (214,477)-(250,540) batch id : 0
[61,1] element, prob = 0.0107422 (458,478)-(488,536) batch id : 0
[62,1] element, prob = 0.0107422 (151,537)-(177,594) batch id : 0
[63,1] element, prob = 0.0107422 (460,522)-(488,590) batch id : 0
[64,1] element, prob = 0.0107422 (481,523)-(509,588) batch id : 0
[65,1] element, prob = 0.0107422 (716,512)-(755,592) batch id : 0
[66,1] element, prob = 0.0107422 (129,581)-(158,641) batch id : 0
[67,1] element, prob = 0.0107422 (150,579)-(179,635) batch id : 0
[68,1] element, prob = 0.0107422 (171,583)-(201,641) batch id : 0
[69,1] element, prob = 0.0107422 (457,564)-(491,658) batch id : 0
[70,1] element, prob = 0.0107422 (481,581)-(510,647) batch id : 0
[71,1] element, prob = 0.0107422 (652,565)-(689,650) batch id : 0
[72,1] element, prob = 0.0107422 (674,571)-(710,650) batch id : 0
[73,1] element, prob = 0.0107422 (694,571)-(734,649) batch id : 0
[74,1] element, prob = 0.0107422 (143,640)-(188,705) batch id : 0
[75,1] element, prob = 0.0107422 (191,743)-(224,805) batch id : 0
[76,1] element, prob = 0.0107422 (437,843)-(465,920) batch id : 0
[77,1] element, prob = 0.0107422 (-1,943)-(22,1037) batch id : 0
[78,1] element, prob = 0.0107422 (414,1007)-(443,1080) batch id : 0
[79,1] element, prob = 0.0107422 (896,1206)-(924,1279) batch id : 0
[80,1] element, prob = 0.0107422 (678,200)-(743,294) batch id : 0
[81,1] element, prob = 0.0107422 (70,374)-(190,512) batch id : 0
[82,1] element, prob = 0.0107422 (422,429)-(485,563) batch id : 0
[83,1] element, prob = 0.0107422 (106,477)-(213,629) batch id : 0
[84,1] element, prob = 0.0107422 (428,477)-(479,615) batch id : 0
[85,1] element, prob = 0.0107422 (648,498)-(727,605) batch id : 0
[86,1] element, prob = 0.0107422 (703,490)-(769,614) batch id : 0
[87,1] element, prob = 0.0107422 (16,531)-(150,712) batch id : 0
[88,1] element, prob = 0.0107422 (87,546)-(150,685) batch id : 0
[89,1] element, prob = 0.0107422 (127,552)-(197,653) batch id : 0
[90,1] element, prob = 0.0107422 (425,557)-(481,671) batch id : 0
[91,1] element, prob = 0.0107422 (437,509)-(516,700) batch id : 0
[92,1] element, prob = 0.0107422 (467,549)-(524,678) batch id : 0
[93,1] element, prob = 0.0107422 (633,551)-(704,664) batch id : 0
[94,1] element, prob = 0.0107422 (416,611)-(487,735) batch id : 0
[95,1] element, prob = 0.0107422 (466,602)-(530,734) batch id : 0
[96,1] element, prob = 0.0107422 (124,673)-(198,759) batch id : 0
[97,1] element, prob = 0.0107422 (156,705)-(260,849) batch id : 0
[98,1] element, prob = 0.0107422 (54,828)-(137,933) batch id : 0
[99,1] element, prob = 0.0107422 (451,812)-(498,960) batch id : 0
[100,1] element, prob = 0.0107422 (470,843)-(520,1004) batch id : 0
[101,1] element, prob = 0.0107422 (447,897)-(500,1066) batch id : 0
[102,1] element, prob = 0.0107422 (641,966)-(706,1122) batch id : 0
[103,1] element, prob = 0.0107422 (164,85)-(233,410) batch id : 0
[104,1] element, prob = 0.0107422 (188,497)-(307,688) batch id : 0
[105,1] element, prob = 0.0107422 (205,445)-(357,715) batch id : 0
[106,1] element, prob = 0.0107422 (230,602)-(341,791) batch id : 0
[107,1] element, prob = 0.0107422 (274,785)-(390,1021) batch id : 0
[108,1] element, prob = 0.0107422 (26,709)-(209,1239) batch id : 0
[109,1] element, prob = 0.0107422 (309,868)-(485,1410) batch id : 0
[110,1] element, prob = 0.0107422 (229,981)-(575,1306) batch id : 0
[111,1] element, prob = 0.0107422 (29,141)-(518,883) batch id : 0
[ INFO ] Image out_0.bmp created!
[ INFO ] Execution successful

[ INFO ] This sample is an API example, for any performance measurements please use the dedicated benchmark_app tool
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
➜  samples ./cpp/build/armv7l/Release/object_detection_sample_ssd -m face-detection-adas-0001.xml -d MYRIAD -i parents.jpg
[ INFO ] InferenceEngine:
API version ............ 2.1
Build .................. 2020.3.0-3467-15f2c61a-releases/2020/3
Description ....... API
Parsing input parameters
[ INFO ] Files were added: 1
[ INFO ] parents.jpg
[ INFO ] Loading Inference Engine
[ INFO ] Device info:
MYRIAD
myriadPlugin version ......... 2.1
Build ........... 2020.3.0-3467-15f2c61a-releases/2020/3
[ INFO ] Loading network files:
face-detection-adas-0001.xml
face-detection-adas-0001.bin
[ INFO ] Preparing input blobs
[ INFO ] Batch size is 1
[ INFO ] Preparing output blobs
[ INFO ] Loading model to the device
[ INFO ] Create infer request
[ WARNING ] Image is resized from (1280, 960) to (672, 384)
[ INFO ] Batch size is 1
[ INFO ] Start inference
[ INFO ] Processing output blobs
[0,1] element, prob = 1 (826,366)-(1026,644) batch id : 0 WILL BE PRINTED!
[1,1] element, prob = 0.996582 (539,173)-(693,429) batch id : 0 WILL BE PRINTED!
[2,1] element, prob = 0.539062 (1094,47)-(1135,96) batch id : 0 WILL BE PRINTED!
[3,1] element, prob = 0.212402 (848,22)-(886,70) batch id : 0
[4,1] element, prob = 0.0527344 (7,783)-(151,957) batch id : 0
[5,1] element, prob = 0.0395508 (1033,78)-(1070,122) batch id : 0
[6,1] element, prob = 0.034668 (1123,75)-(1158,122) batch id : 0
[7,1] element, prob = 0.0322266 (1091,109)-(1130,171) batch id : 0
[8,1] element, prob = 0.0322266 (1086,14)-(1138,85) batch id : 0
[9,1] element, prob = 0.0302734 (1109,43)-(1150,93) batch id : 0
[10,1] element, prob = 0.0292969 (1151,83)-(1190,131) batch id : 0
[11,1] element, prob = 0.0273438 (1030,2)-(1073,43) batch id : 0
[12,1] element, prob = 0.0273438 (1091,6)-(1133,55) batch id : 0
[13,1] element, prob = 0.0273438 (1064,73)-(1098,121) batch id : 0
[14,1] element, prob = 0.0273438 (1058,113)-(1096,168) batch id : 0
[15,1] element, prob = 0.0273438 (1143,74)-(1211,165) batch id : 0
[16,1] element, prob = 0.0268555 (876,73)-(915,118) batch id : 0
[17,1] element, prob = 0.0268555 (1047,-3)-(1110,59) batch id : 0
[18,1] element, prob = 0.0268555 (849,13)-(1030,236) batch id : 0
[19,1] element, prob = 0.0258789 (941,22)-(981,74) batch id : 0
[20,1] element, prob = 0.0258789 (1030,35)-(1074,89) batch id : 0
[21,1] element, prob = 0.0258789 (845,112)-(886,167) batch id : 0
[22,1] element, prob = 0.0258789 (1036,111)-(1076,171) batch id : 0
[23,1] element, prob = 0.0258789 (1113,-1)-(1175,59) batch id : 0
[24,1] element, prob = 0.0258789 (1002,40)-(1093,151) batch id : 0
[25,1] element, prob = 0.0249023 (1059,0)-(1098,43) batch id : 0
[26,1] element, prob = 0.0249023 (876,29)-(918,79) batch id : 0
[27,1] element, prob = 0.0249023 (1002,69)-(1048,123) batch id : 0
[28,1] element, prob = 0.0249023 (1133,104)-(1170,163) batch id : 0
[29,1] element, prob = 0.0249023 (1056,145)-(1094,208) batch id : 0
[30,1] element, prob = 0.0249023 (861,2)-(918,63) batch id : 0
[31,1] element, prob = 0.0239258 (966,1)-(1018,45) batch id : 0
[32,1] element, prob = 0.0239258 (1098,63)-(1131,109) batch id : 0
[33,1] element, prob = 0.0239258 (1010,84)-(1092,204) batch id : 0
[34,1] element, prob = 0.0239258 (1022,139)-(1076,224) batch id : 0
[35,1] element, prob = 0.0239258 (943,34)-(1073,208) batch id : 0
[36,1] element, prob = 0.0229492 (811,3)-(851,48) batch id : 0
[37,1] element, prob = 0.0229492 (1154,27)-(1198,79) batch id : 0
[38,1] element, prob = 0.0229492 (1000,155)-(1046,226) batch id : 0
[39,1] element, prob = 0.0229492 (1086,145)-(1125,208) batch id : 0
[40,1] element, prob = 0.0229492 (958,20)-(1030,84) batch id : 0
[41,1] element, prob = 0.0229492 (934,65)-(986,155) batch id : 0
[42,1] element, prob = 0.0229492 (1045,99)-(1106,178) batch id : 0
[43,1] element, prob = 0.0229492 (983,-9)-(1141,105) batch id : 0
[44,1] element, prob = 0.0229492 (1065,-16)-(1192,124) batch id : 0
[45,1] element, prob = 0.0229492 (922,81)-(1087,304) batch id : 0
[46,1] element, prob = 0.0219727 (796,3)-(834,47) batch id : 0
[47,1] element, prob = 0.0219727 (911,4)-(953,55) batch id : 0
[48,1] element, prob = 0.0219727 (797,29)-(835,79) batch id : 0
[49,1] element, prob = 0.0219727 (821,34)-(855,81) batch id : 0
[50,1] element, prob = 0.0219727 (910,28)-(945,78) batch id : 0
[51,1] element, prob = 0.0219727 (755,77)-(790,125) batch id : 0
[52,1] element, prob = 0.0219727 (969,80)-(1008,128) batch id : 0
[53,1] element, prob = 0.0219727 (938,108)-(980,173) batch id : 0
[54,1] element, prob = 0.0219727 (1123,186)-(1161,252) batch id : 0
[55,1] element, prob = 0.0219727 (985,28)-(1056,105) batch id : 0
[56,1] element, prob = 0.0219727 (845,56)-(898,135) batch id : 0
[57,1] element, prob = 0.0219727 (1023,62)-(1080,131) batch id : 0
[58,1] element, prob = 0.0219727 (1041,40)-(1125,143) batch id : 0
[59,1] element, prob = 0.0219727 (1035,116)-(1110,242) batch id : 0
[60,1] element, prob = 0.0219727 (990,166)-(1054,269) batch id : 0
[61,1] element, prob = 0.0219727 (1078,169)-(1130,261) batch id : 0
[62,1] element, prob = 0.0219727 (971,13)-(1140,235) batch id : 0
[63,1] element, prob = 0.0219727 (980,125)-(1108,286) batch id : 0
[64,1] element, prob = 0.0209961 (940,5)-(987,55) batch id : 0
[65,1] element, prob = 0.0209961 (991,0)-(1043,41) batch id : 0
[66,1] element, prob = 0.0209961 (1126,0)-(1165,42) batch id : 0
[67,1] element, prob = 0.0209961 (998,41)-(1039,86) batch id : 0
[68,1] element, prob = 0.0209961 (1068,40)-(1103,86) batch id : 0
[69,1] element, prob = 0.0209961 (821,77)-(856,123) batch id : 0
[70,1] element, prob = 0.0209961 (913,80)-(949,128) batch id : 0
[71,1] element, prob = 0.0209961 (821,112)-(861,164) batch id : 0
[72,1] element, prob = 0.0209961 (878,113)-(919,175) batch id : 0
[73,1] element, prob = 0.0209961 (910,110)-(950,170) batch id : 0
[74,1] element, prob = 0.0209961 (1149,111)-(1189,163) batch id : 0
[75,1] element, prob = 0.0209961 (870,149)-(918,215) batch id : 0
[76,1] element, prob = 0.0209961 (1033,152)-(1070,209) batch id : 0
[77,1] element, prob = 0.0209961 (1128,141)-(1165,204) batch id : 0
[78,1] element, prob = 0.0209961 (1147,135)-(1188,199) batch id : 0
[79,1] element, prob = 0.0209961 (1064,188)-(1099,246) batch id : 0
[80,1] element, prob = 0.0209961 (1238,903)-(1279,963) batch id : 0
[81,1] element, prob = 0.0209961 (1146,19)-(1208,109) batch id : 0
[82,1] element, prob = 0.0209961 (1054,58)-(1110,126) batch id : 0
[83,1] element, prob = 0.0209961 (1111,99)-(1190,228) batch id : 0
[84,1] element, prob = 0.0209961 (1052,161)-(1105,265) batch id : 0
[85,1] element, prob = 0.0209961 (1060,145)-(1139,284) batch id : 0
[86,1] element, prob = 0.0209961 (-16,860)-(79,985) batch id : 0
[87,1] element, prob = 0.0209961 (1174,-17)-(1281,136) batch id : 0
[88,1] element, prob = 0.0209961 (1073,32)-(1198,190) batch id : 0
[89,1] element, prob = 0.0209961 (950,188)-(1072,366) batch id : 0
[90,1] element, prob = 0.0200195 (943,81)-(978,130) batch id : 0
[91,1] element, prob = 0.0200195 (968,104)-(1008,159) batch id : 0
[92,1] element, prob = 0.0200195 (930,148)-(973,211) batch id : 0
[93,1] element, prob = 0.0200195 (1092,191)-(1128,246) batch id : 0
[94,1] element, prob = 0.0200195 (1124,225)-(1161,291) batch id : 0
[95,1] element, prob = 0.0200195 (1007,-2)-(1083,55) batch id : 0
[96,1] element, prob = 0.0200195 (890,60)-(960,138) batch id : 0
[97,1] element, prob = 0.0200195 (962,65)-(1023,137) batch id : 0
[98,1] element, prob = 0.0200195 (1101,145)-(1183,284) batch id : 0
[99,1] element, prob = 0.0200195 (866,-10)-(1029,107) batch id : 0
[100,1] element, prob = 0.0200195 (1005,179)-(1111,360) batch id : 0
[101,1] element, prob = 0.0200195 (1019,342)-(1283,785) batch id : 0
[102,1] element, prob = 0.019043 (758,2)-(795,45) batch id : 0
[103,1] element, prob = 0.019043 (756,38)-(792,89) batch id : 0
[104,1] element, prob = 0.019043 (968,36)-(1011,82) batch id : 0
[105,1] element, prob = 0.019043 (729,77)-(763,127) batch id : 0
[106,1] element, prob = 0.019043 (1003,109)-(1044,169) batch id : 0
[107,1] element, prob = 0.019043 (1030,190)-(1066,242) batch id : 0
[108,1] element, prob = 0.019043 (887,83)-(971,209) batch id : 0
[109,1] element, prob = 0.019043 (995,99)-(1055,192) batch id : 0
[110,1] element, prob = 0.019043 (902,135)-(963,221) batch id : 0
[ INFO ] Image out_0.bmp created!
object_detection_sample_ssd: ../../libusb/io.c:2116: handle_events: Assertion `ctx->pollfds_cnt >= internal_nfds' failed.
Aborted

For NCS 1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
➜  samples ./cpp/build/armv7l/Release/object_detection_sample_ssd -m face-detection-adas-0001.xml -d MYRIAD -i me.jpg     
[ INFO ] InferenceEngine:
API version ............ 2.1
Build .................. 2020.3.0-3467-15f2c61a-releases/2020/3
Description ....... API
Parsing input parameters
[ INFO ] Files were added: 1
[ INFO ] me.jpg
[ INFO ] Loading Inference Engine
[ INFO ] Device info:
MYRIAD
myriadPlugin version ......... 2.1
Build ........... 2020.3.0-3467-15f2c61a-releases/2020/3
[ INFO ] Loading network files:
face-detection-adas-0001.xml
face-detection-adas-0001.bin
[ INFO ] Preparing input blobs
[ INFO ] Batch size is 1
[ INFO ] Preparing output blobs
[ INFO ] Loading model to the device
[ INFO ] Create infer request
[ WARNING ] Image is resized from (924, 1280) to (672, 384)
[ INFO ] Batch size is 1
[ INFO ] Start inference
[ INFO ] Processing output blobs
object_detection_sample_ssd: ../../libusb/io.c:2116: handle_events: Assertion `ctx->pollfds_cnt >= internal_nfds' failed.
Aborted
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
➜  samples ./cpp/build/armv7l/Release/object_detection_sample_ssd -m face-detection-adas-0001.xml -d MYRIAD -i parents.jpg
[ INFO ] InferenceEngine:
API version ............ 2.1
Build .................. 2020.3.0-3467-15f2c61a-releases/2020/3
Description ....... API
Parsing input parameters
[ INFO ] Files were added: 1
[ INFO ] parents.jpg
[ INFO ] Loading Inference Engine
[ INFO ] Device info:
MYRIAD
myriadPlugin version ......... 2.1
Build ........... 2020.3.0-3467-15f2c61a-releases/2020/3
[ INFO ] Loading network files:
face-detection-adas-0001.xml
face-detection-adas-0001.bin
[ INFO ] Preparing input blobs
[ INFO ] Batch size is 1
[ INFO ] Preparing output blobs
[ INFO ] Loading model to the device
[ INFO ] Create infer request
[ WARNING ] Image is resized from (1280, 960) to (672, 384)
[ INFO ] Batch size is 1
[ INFO ] Start inference
[ INFO ] Processing output blobs
object_detection_sample_ssd: ../../libusb/io.c:2116: handle_events: Assertion `ctx->pollfds_cnt >= internal_nfds' failed.
Aborted

3.3.3 Python

For NCS 2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
➜  samples python ./python/object_detection_sample_ssd/object_detection_sample_ssd.py -m face-detection-adas-0001.xml -d MYRIAD -i me.jpg
[ INFO ] Loading Inference Engine
[ INFO ] Loading network files:
face-detection-adas-0001.xml
face-detection-adas-0001.bin
[ INFO ] Device info:
MYRIAD
MKLDNNPlugin version ......... 2.1
Build ........... 2020.3.0-3467-15f2c61a-releases/2020/3
inputs number: 1
input shape: [1, 3, 384, 672]
input key: data
[ INFO ] File was added:
[ INFO ] me.jpg
[ WARNING ] Image me.jpg is resized from (384, 672) to (384, 672)
[ INFO ] Preparing input blobs
[ INFO ] Batch size is 1
[ INFO ] Preparing output blobs
[ INFO ] Loading model to the device
[ INFO ] Creating infer request and starting inference
[ INFO ] Processing output blobs
[0,1] element, prob = 0.870117 (421,202)-(745,608) batch id : 0 WILL BE PRINTED!
[1,1] element, prob = 0.0268555 (-55,556)-(234,1100) batch id : 0
[2,1] element, prob = 0.0219727 (20,925)-(239,1340) batch id : 0
[3,1] element, prob = 0.0200195 (-18,-144)-(179,581) batch id : 0
[4,1] element, prob = 0.0180664 (636,315)-(757,471) batch id : 0
[5,1] element, prob = 0.0170898 (-27,672)-(137,1217) batch id : 0
[6,1] element, prob = 0.0170898 (74,976)-(364,1322) batch id : 0
[7,1] element, prob = 0.0161133 (291,958)-(349,1122) batch id : 0
[8,1] element, prob = 0.0161133 (329,963)-(391,1126) batch id : 0
[9,1] element, prob = 0.0161133 (203,928)-(423,1346) batch id : 0
[10,1] element, prob = 0.015625 (694,1034)-(732,1140) batch id : 0
[11,1] element, prob = 0.015625 (832,1121)-(937,1295) batch id : 0
[12,1] element, prob = 0.015625 (219,39)-(388,627) batch id : 0
[13,1] element, prob = 0.015625 (76,785)-(357,1160) batch id : 0
[14,1] element, prob = 0.0146484 (355,616)-(475,778) batch id : 0
[15,1] element, prob = 0.0146484 (240,779)-(331,1048) batch id : 0
[16,1] element, prob = 0.0136719 (0,893)-(24,984) batch id : 0
[17,1] element, prob = 0.0136719 (658,306)-(752,405) batch id : 0
[18,1] element, prob = 0.0136719 (204,1198)-(267,1275) batch id : 0
[19,1] element, prob = 0.0136719 (322,611)-(430,794) batch id : 0
[20,1] element, prob = 0.0136719 (171,244)-(423,798) batch id : 0
[21,1] element, prob = 0.0136719 (252,798)-(539,1177) batch id : 0
[22,1] element, prob = 0.0136719 (133,875)-(301,1420) batch id : 0
[23,1] element, prob = 0.0136719 (443,202)-(802,1022) batch id : 0
[24,1] element, prob = 0.0126953 (718,466)-(757,540) batch id : 0
[25,1] element, prob = 0.0126953 (166,527)-(206,594) batch id : 0
[26,1] element, prob = 0.0126953 (694,511)-(731,590) batch id : 0
[27,1] element, prob = 0.0126953 (705,441)-(771,555) batch id : 0
[28,1] element, prob = 0.0126953 (272,962)-(322,1117) batch id : 0
[29,1] element, prob = 0.0126953 (268,486)-(376,688) batch id : 0
[30,1] element, prob = 0.0126953 (323,489)-(422,690) batch id : 0
[31,1] element, prob = 0.0126953 (277,607)-(384,796) batch id : 0
[32,1] element, prob = 0.0126953 (233,709)-(342,924) batch id : 0
[33,1] element, prob = 0.0126953 (256,672)-(406,957) batch id : 0
[34,1] element, prob = 0.0126953 (252,1043)-(431,1214) batch id : 0
[35,1] element, prob = 0.0117188 (695,466)-(733,539) batch id : 0
[36,1] element, prob = 0.0117188 (673,514)-(709,587) batch id : 0
[37,1] element, prob = 0.0117188 (370,1005)-(399,1078) batch id : 0
[38,1] element, prob = 0.0117188 (670,256)-(753,346) batch id : 0
[39,1] element, prob = 0.0117188 (151,500)-(221,610) batch id : 0
[40,1] element, prob = 0.0117188 (447,489)-(511,608) batch id : 0
[41,1] element, prob = 0.0117188 (126,625)-(200,719) batch id : 0
[42,1] element, prob = 0.0117188 (299,626)-(387,709) batch id : 0
[43,1] element, prob = 0.0117188 (164,673)-(251,747) batch id : 0
[44,1] element, prob = 0.0117188 (398,850)-(453,1008) batch id : 0
[45,1] element, prob = 0.0117188 (425,851)-(476,1008) batch id : 0
[46,1] element, prob = 0.0117188 (310,915)-(371,1077) batch id : 0
[47,1] element, prob = 0.0117188 (357,925)-(413,1073) batch id : 0
[48,1] element, prob = 0.0117188 (378,923)-(435,1074) batch id : 0
[49,1] element, prob = 0.0117188 (468,906)-(521,1070) batch id : 0
[50,1] element, prob = 0.0117188 (284,1016)-(357,1188) batch id : 0
[51,1] element, prob = 0.0117188 (203,-95)-(283,182) batch id : 0
[52,1] element, prob = 0.0117188 (269,378)-(374,595) batch id : 0
[53,1] element, prob = 0.0117188 (-22,575)-(71,831) batch id : 0
[54,1] element, prob = 0.0117188 (318,698)-(433,911) batch id : 0
[55,1] element, prob = 0.0117188 (221,716)-(395,1258) batch id : 0
[56,1] element, prob = 0.0117188 (859,771)-(987,1518) batch id : 0
[57,1] element, prob = 0.0107422 (145,466)-(185,527) batch id : 0
[58,1] element, prob = 0.0107422 (166,463)-(204,521) batch id : 0
[59,1] element, prob = 0.0107422 (185,477)-(224,537) batch id : 0
[60,1] element, prob = 0.0107422 (214,477)-(250,540) batch id : 0
[61,1] element, prob = 0.0107422 (458,478)-(488,536) batch id : 0
[62,1] element, prob = 0.0107422 (151,537)-(177,594) batch id : 0
[63,1] element, prob = 0.0107422 (460,522)-(488,590) batch id : 0
[64,1] element, prob = 0.0107422 (481,523)-(509,588) batch id : 0
[65,1] element, prob = 0.0107422 (716,512)-(755,592) batch id : 0
[66,1] element, prob = 0.0107422 (129,581)-(158,641) batch id : 0
[67,1] element, prob = 0.0107422 (150,579)-(179,635) batch id : 0
[68,1] element, prob = 0.0107422 (171,583)-(201,641) batch id : 0
[69,1] element, prob = 0.0107422 (457,564)-(491,658) batch id : 0
[70,1] element, prob = 0.0107422 (481,581)-(510,647) batch id : 0
[71,1] element, prob = 0.0107422 (652,565)-(689,650) batch id : 0
[72,1] element, prob = 0.0107422 (674,571)-(710,650) batch id : 0
[73,1] element, prob = 0.0107422 (694,571)-(734,649) batch id : 0
[74,1] element, prob = 0.0107422 (143,640)-(188,705) batch id : 0
[75,1] element, prob = 0.0107422 (191,743)-(224,805) batch id : 0
[76,1] element, prob = 0.0107422 (437,843)-(465,920) batch id : 0
[77,1] element, prob = 0.0107422 (-1,943)-(22,1037) batch id : 0
[78,1] element, prob = 0.0107422 (414,1007)-(443,1080) batch id : 0
[79,1] element, prob = 0.0107422 (896,1206)-(924,1279) batch id : 0
[80,1] element, prob = 0.0107422 (678,200)-(743,294) batch id : 0
[81,1] element, prob = 0.0107422 (70,374)-(190,512) batch id : 0
[82,1] element, prob = 0.0107422 (422,429)-(485,563) batch id : 0
[83,1] element, prob = 0.0107422 (106,477)-(213,629) batch id : 0
[84,1] element, prob = 0.0107422 (428,477)-(479,615) batch id : 0
[85,1] element, prob = 0.0107422 (648,498)-(727,605) batch id : 0
[86,1] element, prob = 0.0107422 (703,490)-(769,614) batch id : 0
[87,1] element, prob = 0.0107422 (16,531)-(150,712) batch id : 0
[88,1] element, prob = 0.0107422 (87,546)-(150,685) batch id : 0
[89,1] element, prob = 0.0107422 (127,552)-(197,653) batch id : 0
[90,1] element, prob = 0.0107422 (425,557)-(481,671) batch id : 0
[91,1] element, prob = 0.0107422 (437,509)-(516,700) batch id : 0
[92,1] element, prob = 0.0107422 (467,549)-(524,678) batch id : 0
[93,1] element, prob = 0.0107422 (633,551)-(704,664) batch id : 0
[94,1] element, prob = 0.0107422 (416,611)-(487,735) batch id : 0
[95,1] element, prob = 0.0107422 (466,602)-(530,734) batch id : 0
[96,1] element, prob = 0.0107422 (124,673)-(198,759) batch id : 0
[97,1] element, prob = 0.0107422 (156,705)-(260,849) batch id : 0
[98,1] element, prob = 0.0107422 (54,828)-(137,933) batch id : 0
[99,1] element, prob = 0.0107422 (451,812)-(498,960) batch id : 0
[100,1] element, prob = 0.0107422 (470,843)-(520,1004) batch id : 0
[101,1] element, prob = 0.0107422 (447,897)-(500,1066) batch id : 0
[102,1] element, prob = 0.0107422 (641,966)-(706,1122) batch id : 0
[103,1] element, prob = 0.0107422 (164,85)-(233,410) batch id : 0
[104,1] element, prob = 0.0107422 (188,497)-(307,688) batch id : 0
[105,1] element, prob = 0.0107422 (205,445)-(357,715) batch id : 0
[106,1] element, prob = 0.0107422 (230,602)-(341,791) batch id : 0
[107,1] element, prob = 0.0107422 (274,785)-(390,1021) batch id : 0
[108,1] element, prob = 0.0107422 (26,709)-(209,1239) batch id : 0
[109,1] element, prob = 0.0107422 (309,868)-(485,1410) batch id : 0
[110,1] element, prob = 0.0107422 (229,981)-(575,1306) batch id : 0
[111,1] element, prob = 0.0107422 (29,141)-(518,883) batch id : 0
[ INFO ] Image out.bmp created!
[ INFO ] Execution successful

[ INFO ] This sample is an API example, for any performance measurements please use the dedicated benchmark_app tool
corrupted double-linked list
Aborted
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
➜  samples python ./python/object_detection_sample_ssd/object_detection_sample_ssd.py -m face-detection-adas-0001.xml -d MYRIAD -i parents.jpg
[ INFO ] Loading Inference Engine
[ INFO ] Loading network files:
face-detection-adas-0001.xml
face-detection-adas-0001.bin
[ INFO ] Device info:
MYRIAD
MKLDNNPlugin version ......... 2.1
Build ........... 2020.3.0-3467-15f2c61a-releases/2020/3
inputs number: 1
input shape: [1, 3, 384, 672]
input key: data
[ INFO ] File was added:
[ INFO ] parents.jpg
[ WARNING ] Image parents.jpg is resized from (384, 672) to (384, 672)
[ INFO ] Preparing input blobs
[ INFO ] Batch size is 1
[ INFO ] Preparing output blobs
[ INFO ] Loading model to the device
[ INFO ] Creating infer request and starting inference
[ INFO ] Processing output blobs
[0,1] element, prob = 1.0 (826,366)-(1026,644) batch id : 0 WILL BE PRINTED!
[1,1] element, prob = 0.996582 (539,173)-(693,429) batch id : 0 WILL BE PRINTED!
[2,1] element, prob = 0.539062 (1094,47)-(1135,96) batch id : 0 WILL BE PRINTED!
[3,1] element, prob = 0.212402 (848,22)-(886,70) batch id : 0
[4,1] element, prob = 0.0527344 (7,783)-(151,957) batch id : 0
[5,1] element, prob = 0.0395508 (1033,78)-(1070,122) batch id : 0
[6,1] element, prob = 0.034668 (1123,75)-(1158,122) batch id : 0
[7,1] element, prob = 0.0322266 (1091,109)-(1130,171) batch id : 0
[8,1] element, prob = 0.0322266 (1086,14)-(1138,85) batch id : 0
[9,1] element, prob = 0.0302734 (1109,43)-(1150,93) batch id : 0
[10,1] element, prob = 0.0292969 (1151,83)-(1190,131) batch id : 0
[11,1] element, prob = 0.0273438 (1030,2)-(1073,43) batch id : 0
[12,1] element, prob = 0.0273438 (1091,6)-(1133,55) batch id : 0
[13,1] element, prob = 0.0273438 (1064,73)-(1098,121) batch id : 0
[14,1] element, prob = 0.0273438 (1058,113)-(1096,168) batch id : 0
[15,1] element, prob = 0.0273438 (1143,74)-(1211,165) batch id : 0
[16,1] element, prob = 0.0268555 (876,73)-(915,118) batch id : 0
[17,1] element, prob = 0.0268555 (1047,-3)-(1110,59) batch id : 0
[18,1] element, prob = 0.0268555 (849,13)-(1030,236) batch id : 0
[19,1] element, prob = 0.0258789 (941,22)-(981,74) batch id : 0
[20,1] element, prob = 0.0258789 (1030,35)-(1074,89) batch id : 0
[21,1] element, prob = 0.0258789 (845,112)-(886,167) batch id : 0
[22,1] element, prob = 0.0258789 (1036,111)-(1076,171) batch id : 0
[23,1] element, prob = 0.0258789 (1113,-1)-(1175,59) batch id : 0
[24,1] element, prob = 0.0258789 (1002,40)-(1093,151) batch id : 0
[25,1] element, prob = 0.0249023 (1059,0)-(1098,43) batch id : 0
[26,1] element, prob = 0.0249023 (876,29)-(918,79) batch id : 0
[27,1] element, prob = 0.0249023 (1002,69)-(1048,123) batch id : 0
[28,1] element, prob = 0.0249023 (1133,104)-(1170,163) batch id : 0
[29,1] element, prob = 0.0249023 (1056,145)-(1094,208) batch id : 0
[30,1] element, prob = 0.0249023 (861,2)-(918,63) batch id : 0
[31,1] element, prob = 0.0239258 (966,1)-(1018,45) batch id : 0
[32,1] element, prob = 0.0239258 (1098,63)-(1131,109) batch id : 0
[33,1] element, prob = 0.0239258 (1010,84)-(1092,204) batch id : 0
[34,1] element, prob = 0.0239258 (1022,139)-(1076,224) batch id : 0
[35,1] element, prob = 0.0239258 (943,34)-(1073,208) batch id : 0
[36,1] element, prob = 0.0229492 (811,3)-(851,48) batch id : 0
[37,1] element, prob = 0.0229492 (1154,27)-(1198,79) batch id : 0
[38,1] element, prob = 0.0229492 (1000,155)-(1046,226) batch id : 0
[39,1] element, prob = 0.0229492 (1086,145)-(1125,208) batch id : 0
[40,1] element, prob = 0.0229492 (958,20)-(1030,84) batch id : 0
[41,1] element, prob = 0.0229492 (934,65)-(986,155) batch id : 0
[42,1] element, prob = 0.0229492 (1045,99)-(1106,178) batch id : 0
[43,1] element, prob = 0.0229492 (983,-9)-(1141,105) batch id : 0
[44,1] element, prob = 0.0229492 (1065,-16)-(1192,124) batch id : 0
[45,1] element, prob = 0.0229492 (922,81)-(1087,304) batch id : 0
[46,1] element, prob = 0.0219727 (796,3)-(834,47) batch id : 0
[47,1] element, prob = 0.0219727 (911,4)-(953,55) batch id : 0
[48,1] element, prob = 0.0219727 (797,29)-(835,79) batch id : 0
[49,1] element, prob = 0.0219727 (821,34)-(855,81) batch id : 0
[50,1] element, prob = 0.0219727 (910,28)-(945,78) batch id : 0
[51,1] element, prob = 0.0219727 (755,77)-(790,125) batch id : 0
[52,1] element, prob = 0.0219727 (969,80)-(1008,128) batch id : 0
[53,1] element, prob = 0.0219727 (938,108)-(980,173) batch id : 0
[54,1] element, prob = 0.0219727 (1123,186)-(1161,252) batch id : 0
[55,1] element, prob = 0.0219727 (985,28)-(1056,105) batch id : 0
[56,1] element, prob = 0.0219727 (845,56)-(898,135) batch id : 0
[57,1] element, prob = 0.0219727 (1023,62)-(1080,131) batch id : 0
[58,1] element, prob = 0.0219727 (1041,40)-(1125,143) batch id : 0
[59,1] element, prob = 0.0219727 (1035,116)-(1110,242) batch id : 0
[60,1] element, prob = 0.0219727 (990,166)-(1054,269) batch id : 0
[61,1] element, prob = 0.0219727 (1078,169)-(1130,261) batch id : 0
[62,1] element, prob = 0.0219727 (971,13)-(1140,235) batch id : 0
[63,1] element, prob = 0.0219727 (980,125)-(1108,286) batch id : 0
[64,1] element, prob = 0.0209961 (940,5)-(987,55) batch id : 0
[65,1] element, prob = 0.0209961 (991,0)-(1043,41) batch id : 0
[66,1] element, prob = 0.0209961 (1126,0)-(1165,42) batch id : 0
[67,1] element, prob = 0.0209961 (998,41)-(1039,86) batch id : 0
[68,1] element, prob = 0.0209961 (1068,40)-(1103,86) batch id : 0
[69,1] element, prob = 0.0209961 (821,77)-(856,123) batch id : 0
[70,1] element, prob = 0.0209961 (913,80)-(949,128) batch id : 0
[71,1] element, prob = 0.0209961 (821,112)-(861,164) batch id : 0
[72,1] element, prob = 0.0209961 (878,113)-(919,175) batch id : 0
[73,1] element, prob = 0.0209961 (910,110)-(950,170) batch id : 0
[74,1] element, prob = 0.0209961 (1149,111)-(1189,163) batch id : 0
[75,1] element, prob = 0.0209961 (870,149)-(918,215) batch id : 0
[76,1] element, prob = 0.0209961 (1033,152)-(1070,209) batch id : 0
[77,1] element, prob = 0.0209961 (1128,141)-(1165,204) batch id : 0
[78,1] element, prob = 0.0209961 (1147,135)-(1188,199) batch id : 0
[79,1] element, prob = 0.0209961 (1064,188)-(1099,246) batch id : 0
[80,1] element, prob = 0.0209961 (1238,903)-(1279,963) batch id : 0
[81,1] element, prob = 0.0209961 (1146,19)-(1208,109) batch id : 0
[82,1] element, prob = 0.0209961 (1054,58)-(1110,126) batch id : 0
[83,1] element, prob = 0.0209961 (1111,99)-(1190,228) batch id : 0
[84,1] element, prob = 0.0209961 (1052,161)-(1105,265) batch id : 0
[85,1] element, prob = 0.0209961 (1060,145)-(1139,284) batch id : 0
[86,1] element, prob = 0.0209961 (-16,860)-(79,985) batch id : 0
[87,1] element, prob = 0.0209961 (1174,-17)-(1281,136) batch id : 0
[88,1] element, prob = 0.0209961 (1073,32)-(1198,190) batch id : 0
[89,1] element, prob = 0.0209961 (950,188)-(1072,366) batch id : 0
[90,1] element, prob = 0.0200195 (943,81)-(978,130) batch id : 0
[91,1] element, prob = 0.0200195 (968,104)-(1008,159) batch id : 0
[92,1] element, prob = 0.0200195 (930,148)-(973,211) batch id : 0
[93,1] element, prob = 0.0200195 (1092,191)-(1128,246) batch id : 0
[94,1] element, prob = 0.0200195 (1124,225)-(1161,291) batch id : 0
[95,1] element, prob = 0.0200195 (1007,-2)-(1083,55) batch id : 0
[96,1] element, prob = 0.0200195 (890,60)-(960,138) batch id : 0
[97,1] element, prob = 0.0200195 (962,65)-(1023,137) batch id : 0
[98,1] element, prob = 0.0200195 (1101,145)-(1183,284) batch id : 0
[99,1] element, prob = 0.0200195 (866,-10)-(1029,107) batch id : 0
[100,1] element, prob = 0.0200195 (1005,179)-(1111,360) batch id : 0
[101,1] element, prob = 0.0200195 (1019,342)-(1283,785) batch id : 0
[102,1] element, prob = 0.019043 (758,2)-(795,45) batch id : 0
[103,1] element, prob = 0.019043 (756,38)-(792,89) batch id : 0
[104,1] element, prob = 0.019043 (968,36)-(1011,82) batch id : 0
[105,1] element, prob = 0.019043 (729,77)-(763,127) batch id : 0
[106,1] element, prob = 0.019043 (1003,109)-(1044,169) batch id : 0
[107,1] element, prob = 0.019043 (1030,190)-(1066,242) batch id : 0
[108,1] element, prob = 0.019043 (887,83)-(971,209) batch id : 0
[109,1] element, prob = 0.019043 (995,99)-(1055,192) batch id : 0
[110,1] element, prob = 0.019043 (902,135)-(963,221) batch id : 0
[ INFO ] Image out.bmp created!
[ INFO ] Execution successful

[ INFO ] This sample is an API example, for any performance measurements please use the dedicated benchmark_app tool
free(): invalid pointer
Aborted

For NCS 1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
➜  samples python ./python/object_detection_sample_ssd/object_detection_sample_ssd.py -m face-detection-adas-0001.xml -d MYRIAD -i me.jpg
[ INFO ] Loading Inference Engine
[ INFO ] Loading network files:
face-detection-adas-0001.xml
face-detection-adas-0001.bin
[ INFO ] Device info:
MYRIAD
MKLDNNPlugin version ......... 2.1
Build ........... 2020.3.0-3467-15f2c61a-releases/2020/3
inputs number: 1
input shape: [1, 3, 384, 672]
input key: data
[ INFO ] File was added:
[ INFO ] me.jpg
[ WARNING ] Image me.jpg is resized from (384, 672) to (384, 672)
[ INFO ] Preparing input blobs
[ INFO ] Batch size is 1
[ INFO ] Preparing output blobs
[ INFO ] Loading model to the device
[ INFO ] Creating infer request and starting inference
[ INFO ] Processing output blobs
[0,1] element, prob = 0.871094 (420,202)-(745,608) batch id : 0 WILL BE PRINTED!
[1,1] element, prob = 0.0268555 (-54,555)-(234,1100) batch id : 0
[2,1] element, prob = 0.0209961 (21,925)-(239,1340) batch id : 0
[3,1] element, prob = 0.019043 (-18,-144)-(178,583) batch id : 0
[4,1] element, prob = 0.0180664 (636,315)-(757,470) batch id : 0
[5,1] element, prob = 0.0170898 (75,977)-(363,1321) batch id : 0
[6,1] element, prob = 0.0161133 (291,958)-(349,1123) batch id : 0
[7,1] element, prob = 0.015625 (329,962)-(391,1126) batch id : 0
[8,1] element, prob = 0.015625 (832,1121)-(937,1293) batch id : 0
[9,1] element, prob = 0.015625 (-27,670)-(136,1220) batch id : 0
[10,1] element, prob = 0.015625 (76,785)-(357,1160) batch id : 0
[11,1] element, prob = 0.015625 (204,928)-(423,1346) batch id : 0
[12,1] element, prob = 0.0146484 (694,1035)-(732,1141) batch id : 0
[13,1] element, prob = 0.0146484 (219,40)-(388,626) batch id : 0
[14,1] element, prob = 0.0136719 (658,306)-(752,405) batch id : 0
[15,1] element, prob = 0.0136719 (204,1198)-(267,1275) batch id : 0
[16,1] element, prob = 0.0136719 (322,612)-(430,793) batch id : 0
[17,1] element, prob = 0.0136719 (240,779)-(331,1046) batch id : 0
[18,1] element, prob = 0.0136719 (171,245)-(424,798) batch id : 0
[19,1] element, prob = 0.0136719 (443,205)-(802,1021) batch id : 0
[20,1] element, prob = 0.0126953 (694,511)-(731,590) batch id : 0
[21,1] element, prob = 0.0126953 (0,893)-(24,984) batch id : 0
[22,1] element, prob = 0.0126953 (272,962)-(322,1117) batch id : 0
[23,1] element, prob = 0.0126953 (268,487)-(376,688) batch id : 0
[24,1] element, prob = 0.0126953 (323,490)-(422,690) batch id : 0
[25,1] element, prob = 0.0126953 (277,608)-(384,795) batch id : 0
[26,1] element, prob = 0.0126953 (233,710)-(342,923) batch id : 0
[27,1] element, prob = 0.0126953 (256,672)-(406,957) batch id : 0
[28,1] element, prob = 0.0126953 (252,799)-(540,1176) batch id : 0
[29,1] element, prob = 0.0126953 (133,876)-(301,1420) batch id : 0
[30,1] element, prob = 0.0117188 (718,466)-(757,540) batch id : 0
[31,1] element, prob = 0.0117188 (166,527)-(206,594) batch id : 0
[32,1] element, prob = 0.0117188 (673,514)-(709,587) batch id : 0
[33,1] element, prob = 0.0117188 (-1,943)-(22,1038) batch id : 0
[34,1] element, prob = 0.0117188 (670,256)-(753,346) batch id : 0
[35,1] element, prob = 0.0117188 (705,441)-(771,555) batch id : 0
[36,1] element, prob = 0.0117188 (126,625)-(200,718) batch id : 0
[37,1] element, prob = 0.0117188 (164,673)-(251,747) batch id : 0
[38,1] element, prob = 0.0117188 (399,850)-(453,1008) batch id : 0
[39,1] element, prob = 0.0117188 (424,851)-(476,1009) batch id : 0
[40,1] element, prob = 0.0117188 (357,925)-(413,1073) batch id : 0
[41,1] element, prob = 0.0117188 (399,919)-(454,1074) batch id : 0
[42,1] element, prob = 0.0117188 (468,906)-(521,1070) batch id : 0
[43,1] element, prob = 0.0117188 (284,1016)-(357,1186) batch id : 0
[44,1] element, prob = 0.0117188 (269,379)-(374,595) batch id : 0
[45,1] element, prob = 0.0117188 (349,563)-(485,831) batch id : 0
[46,1] element, prob = 0.0117188 (252,1042)-(431,1215) batch id : 0
[47,1] element, prob = 0.0117188 (858,771)-(987,1518) batch id : 0
[48,1] element, prob = 0.0107422 (165,463)-(204,521) batch id : 0
[49,1] element, prob = 0.0107422 (185,477)-(224,537) batch id : 0
[50,1] element, prob = 0.0107422 (214,477)-(250,540) batch id : 0
[51,1] element, prob = 0.0107422 (458,478)-(488,536) batch id : 0
[52,1] element, prob = 0.0107422 (695,466)-(733,539) batch id : 0
[53,1] element, prob = 0.0107422 (460,522)-(488,590) batch id : 0
[54,1] element, prob = 0.0107422 (481,523)-(509,588) batch id : 0
[55,1] element, prob = 0.0107422 (716,512)-(755,592) batch id : 0
[56,1] element, prob = 0.0107422 (150,579)-(179,635) batch id : 0
[57,1] element, prob = 0.0107422 (171,584)-(201,641) batch id : 0
[58,1] element, prob = 0.0107422 (481,582)-(510,647) batch id : 0
[59,1] element, prob = 0.0107422 (652,565)-(689,650) batch id : 0
[60,1] element, prob = 0.0107422 (674,571)-(710,650) batch id : 0
[61,1] element, prob = 0.0107422 (694,571)-(734,648) batch id : 0
[62,1] element, prob = 0.0107422 (142,640)-(188,705) batch id : 0
[63,1] element, prob = 0.0107422 (335,627)-(390,695) batch id : 0
[64,1] element, prob = 0.0107422 (191,744)-(225,803) batch id : 0
[65,1] element, prob = 0.0107422 (370,1005)-(399,1078) batch id : 0
[66,1] element, prob = 0.0107422 (414,1006)-(443,1079) batch id : 0
[67,1] element, prob = 0.0107422 (896,1207)-(924,1280) batch id : 0
[68,1] element, prob = 0.0107422 (86,386)-(160,513) batch id : 0
[69,1] element, prob = 0.0107422 (106,477)-(214,630) batch id : 0
[70,1] element, prob = 0.0107422 (151,501)-(221,610) batch id : 0
[71,1] element, prob = 0.0107422 (428,478)-(479,615) batch id : 0
[72,1] element, prob = 0.0107422 (450,478)-(506,611) batch id : 0
[73,1] element, prob = 0.0107422 (647,498)-(728,605) batch id : 0
[74,1] element, prob = 0.0107422 (148,556)-(220,658) batch id : 0
[75,1] element, prob = 0.0107422 (425,557)-(481,671) batch id : 0
[76,1] element, prob = 0.0107422 (437,510)-(516,700) batch id : 0
[77,1] element, prob = 0.0107422 (463,554)-(527,674) batch id : 0
[78,1] element, prob = 0.0107422 (633,551)-(704,664) batch id : 0
[79,1] element, prob = 0.0107422 (280,628)-(367,711) batch id : 0
[80,1] element, prob = 0.0107422 (416,612)-(488,735) batch id : 0
[81,1] element, prob = 0.0107422 (155,706)-(260,850) batch id : 0
[82,1] element, prob = 0.0107422 (55,828)-(137,932) batch id : 0
[83,1] element, prob = 0.0107422 (451,813)-(498,960) batch id : 0
[84,1] element, prob = 0.0107422 (310,914)-(371,1076) batch id : 0
[85,1] element, prob = 0.0107422 (447,896)-(500,1065) batch id : 0
[86,1] element, prob = 0.0107422 (641,966)-(706,1121) batch id : 0
[87,1] element, prob = 0.0107422 (203,-95)-(283,182) batch id : 0
[88,1] element, prob = 0.0107422 (164,86)-(233,410) batch id : 0
[89,1] element, prob = 0.0107422 (188,498)-(307,688) batch id : 0
[90,1] element, prob = 0.0107422 (205,445)-(357,715) batch id : 0
[91,1] element, prob = 0.0107422 (-22,576)-(71,832) batch id : 0
[92,1] element, prob = 0.0107422 (230,603)-(342,791) batch id : 0
[93,1] element, prob = 0.0107422 (318,698)-(433,909) batch id : 0
[94,1] element, prob = 0.0107422 (273,784)-(390,1021) batch id : 0
[95,1] element, prob = 0.0107422 (175,740)-(444,1237) batch id : 0
[ INFO ] Image out.bmp created!
[ INFO ] Execution successful

[ INFO ] This sample is an API example, for any performance measurements please use the dedicated benchmark_app tool
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
➜  samples python ./python/object_detection_sample_ssd/object_detection_sample_ssd.py -m face-detection-adas-0001.xml -d MYRIAD -i parents.jpg
[ INFO ] Loading Inference Engine
[ INFO ] Loading network files:
face-detection-adas-0001.xml
face-detection-adas-0001.bin
[ INFO ] Device info:
MYRIAD
MKLDNNPlugin version ......... 2.1
Build ........... 2020.3.0-3467-15f2c61a-releases/2020/3
inputs number: 1
input shape: [1, 3, 384, 672]
input key: data
[ INFO ] File was added:
[ INFO ] parents.jpg
[ WARNING ] Image parents.jpg is resized from (384, 672) to (384, 672)
[ INFO ] Preparing input blobs
[ INFO ] Batch size is 1
[ INFO ] Preparing output blobs
[ INFO ] Loading model to the device
[ INFO ] Creating infer request and starting inference
[ INFO ] Processing output blobs
[0,1] element, prob = 1.0 (826,366)-(1026,644) batch id : 0 WILL BE PRINTED!
[1,1] element, prob = 0.996582 (539,173)-(693,429) batch id : 0 WILL BE PRINTED!
[2,1] element, prob = 0.552734 (1094,47)-(1135,95) batch id : 0 WILL BE PRINTED!
[3,1] element, prob = 0.22168 (848,22)-(886,70) batch id : 0
[4,1] element, prob = 0.0537109 (8,784)-(151,956) batch id : 0
[5,1] element, prob = 0.0395508 (1033,78)-(1070,122) batch id : 0
[6,1] element, prob = 0.034668 (1123,75)-(1158,122) batch id : 0
[7,1] element, prob = 0.0322266 (1086,14)-(1138,85) batch id : 0
[8,1] element, prob = 0.03125 (1091,110)-(1130,171) batch id : 0
[9,1] element, prob = 0.0302734 (1108,43)-(1150,93) batch id : 0
[10,1] element, prob = 0.0292969 (1151,83)-(1190,131) batch id : 0
[11,1] element, prob = 0.0273438 (1091,6)-(1133,55) batch id : 0
[12,1] element, prob = 0.0273438 (1064,73)-(1098,121) batch id : 0
[13,1] element, prob = 0.0268555 (1030,2)-(1073,42) batch id : 0
[14,1] element, prob = 0.0268555 (1058,113)-(1096,168) batch id : 0
[15,1] element, prob = 0.0268555 (1047,-3)-(1110,59) batch id : 0
[16,1] element, prob = 0.0268555 (1142,75)-(1211,165) batch id : 0
[17,1] element, prob = 0.0268555 (849,14)-(1030,236) batch id : 0
[18,1] element, prob = 0.0258789 (941,22)-(981,74) batch id : 0
[19,1] element, prob = 0.0258789 (1030,36)-(1074,89) batch id : 0
[20,1] element, prob = 0.0258789 (876,73)-(915,118) batch id : 0
[21,1] element, prob = 0.0258789 (845,112)-(886,167) batch id : 0
[22,1] element, prob = 0.0258789 (1036,110)-(1076,171) batch id : 0
[23,1] element, prob = 0.0258789 (1113,-1)-(1175,59) batch id : 0
[24,1] element, prob = 0.0258789 (1003,41)-(1094,151) batch id : 0
[25,1] element, prob = 0.0249023 (1059,0)-(1098,43) batch id : 0
[26,1] element, prob = 0.0249023 (1002,69)-(1048,123) batch id : 0
[27,1] element, prob = 0.0249023 (1133,105)-(1170,164) batch id : 0
[28,1] element, prob = 0.0239258 (966,1)-(1018,45) batch id : 0
[29,1] element, prob = 0.0239258 (876,29)-(918,79) batch id : 0
[30,1] element, prob = 0.0239258 (1056,145)-(1094,208) batch id : 0
[31,1] element, prob = 0.0239258 (861,2)-(918,63) batch id : 0
[32,1] element, prob = 0.0239258 (1010,84)-(1092,204) batch id : 0
[33,1] element, prob = 0.0239258 (1022,139)-(1076,224) batch id : 0
[34,1] element, prob = 0.0239258 (942,35)-(1072,208) batch id : 0
[35,1] element, prob = 0.0229492 (811,3)-(851,48) batch id : 0
[36,1] element, prob = 0.0229492 (1098,63)-(1131,109) batch id : 0
[37,1] element, prob = 0.0229492 (983,-9)-(1141,105) batch id : 0
[38,1] element, prob = 0.0229492 (921,81)-(1087,304) batch id : 0
[39,1] element, prob = 0.0219727 (796,3)-(835,47) batch id : 0
[40,1] element, prob = 0.0219727 (911,4)-(953,55) batch id : 0
[41,1] element, prob = 0.0219727 (797,29)-(835,79) batch id : 0
[42,1] element, prob = 0.0219727 (1154,27)-(1198,79) batch id : 0
[43,1] element, prob = 0.0219727 (969,80)-(1008,128) batch id : 0
[44,1] element, prob = 0.0219727 (1000,155)-(1046,226) batch id : 0
[45,1] element, prob = 0.0219727 (1086,145)-(1125,208) batch id : 0
[46,1] element, prob = 0.0219727 (1123,186)-(1161,252) batch id : 0
[47,1] element, prob = 0.0219727 (958,20)-(1030,84) batch id : 0
[48,1] element, prob = 0.0219727 (985,28)-(1056,105) batch id : 0
[49,1] element, prob = 0.0219727 (845,56)-(898,134) batch id : 0
[50,1] element, prob = 0.0219727 (934,65)-(986,155) batch id : 0
[51,1] element, prob = 0.0219727 (1046,99)-(1107,178) batch id : 0
[52,1] element, prob = 0.0219727 (1035,116)-(1110,241) batch id : 0
[53,1] element, prob = 0.0219727 (990,166)-(1054,269) batch id : 0
[54,1] element, prob = 0.0219727 (1065,-16)-(1192,124) batch id : 0
[55,1] element, prob = 0.0219727 (971,13)-(1140,235) batch id : 0
[56,1] element, prob = 0.0219727 (980,125)-(1108,286) batch id : 0
[57,1] element, prob = 0.0209961 (991,0)-(1043,41) batch id : 0
[58,1] element, prob = 0.0209961 (1126,0)-(1165,42) batch id : 0
[59,1] element, prob = 0.0209961 (821,35)-(856,79) batch id : 0
[60,1] element, prob = 0.0209961 (910,28)-(945,78) batch id : 0
[61,1] element, prob = 0.0209961 (997,41)-(1038,86) batch id : 0
[62,1] element, prob = 0.0209961 (1068,40)-(1103,86) batch id : 0
[63,1] element, prob = 0.0209961 (754,77)-(789,125) batch id : 0
[64,1] element, prob = 0.0209961 (819,77)-(855,123) batch id : 0
[65,1] element, prob = 0.0209961 (913,79)-(949,128) batch id : 0
[66,1] element, prob = 0.0209961 (821,112)-(861,164) batch id : 0
[67,1] element, prob = 0.0209961 (938,108)-(980,173) batch id : 0
[68,1] element, prob = 0.0209961 (1149,112)-(1189,162) batch id : 0
[69,1] element, prob = 0.0209961 (870,149)-(918,215) batch id : 0
[70,1] element, prob = 0.0209961 (1033,152)-(1070,209) batch id : 0
[71,1] element, prob = 0.0209961 (1064,188)-(1099,246) batch id : 0
[72,1] element, prob = 0.0209961 (1023,63)-(1081,131) batch id : 0
[73,1] element, prob = 0.0209961 (1054,58)-(1110,126) batch id : 0
[74,1] element, prob = 0.0209961 (1041,40)-(1125,143) batch id : 0
[75,1] element, prob = 0.0209961 (1111,99)-(1190,228) batch id : 0
[76,1] element, prob = 0.0209961 (1078,169)-(1130,261) batch id : 0
[77,1] element, prob = 0.0209961 (950,189)-(1072,367) batch id : 0
[78,1] element, prob = 0.0200195 (940,6)-(987,56) batch id : 0
[79,1] element, prob = 0.0200195 (943,81)-(978,130) batch id : 0
[80,1] element, prob = 0.0200195 (878,114)-(919,175) batch id : 0
[81,1] element, prob = 0.0200195 (910,110)-(950,170) batch id : 0
[82,1] element, prob = 0.0200195 (968,104)-(1008,159) batch id : 0
[83,1] element, prob = 0.0200195 (1128,141)-(1165,204) batch id : 0
[84,1] element, prob = 0.0200195 (1147,135)-(1188,199) batch id : 0
[85,1] element, prob = 0.0200195 (1238,903)-(1279,963) batch id : 0
[86,1] element, prob = 0.0200195 (1007,-2)-(1083,55) batch id : 0
[87,1] element, prob = 0.0200195 (1052,161)-(1105,266) batch id : 0
[88,1] element, prob = 0.0200195 (1061,145)-(1140,284) batch id : 0
[89,1] element, prob = 0.0200195 (-16,860)-(79,985) batch id : 0
[90,1] element, prob = 0.0200195 (866,-10)-(1029,107) batch id : 0
[91,1] element, prob = 0.0200195 (1173,-17)-(1280,136) batch id : 0
[92,1] element, prob = 0.0200195 (1072,32)-(1197,189) batch id : 0
[93,1] element, prob = 0.0200195 (1005,179)-(1111,359) batch id : 0
[94,1] element, prob = 0.019043 (758,2)-(795,45) batch id : 0
[95,1] element, prob = 0.019043 (968,35)-(1011,82) batch id : 0
[96,1] element, prob = 0.019043 (1003,109)-(1044,169) batch id : 0
[97,1] element, prob = 0.019043 (930,148)-(973,211) batch id : 0
[98,1] element, prob = 0.019043 (1092,191)-(1128,246) batch id : 0
[99,1] element, prob = 0.019043 (1123,225)-(1161,291) batch id : 0
[100,1] element, prob = 0.019043 (1146,19)-(1208,109) batch id : 0
[101,1] element, prob = 0.019043 (897,59)-(958,143) batch id : 0
[102,1] element, prob = 0.019043 (962,65)-(1023,137) batch id : 0
[103,1] element, prob = 0.019043 (886,83)-(971,209) batch id : 0
[104,1] element, prob = 0.019043 (995,99)-(1055,192) batch id : 0
[105,1] element, prob = 0.019043 (902,135)-(963,221) batch id : 0
[106,1] element, prob = 0.019043 (1101,145)-(1183,284) batch id : 0
[107,1] element, prob = 0.019043 (821,-17)-(946,129) batch id : 0
[108,1] element, prob = 0.019043 (940,-16)-(1076,120) batch id : 0
[109,1] element, prob = 0.019043 (819,34)-(945,205) batch id : 0
[110,1] element, prob = 0.019043 (1019,342)-(1283,785) batch id : 0
[111,1] element, prob = 0.0180664 (1147,7)-(1193,54) batch id : 0
[112,1] element, prob = 0.0180664 (756,38)-(792,89) batch id : 0
[ INFO ] Image out.bmp created!
[ INFO ] Execution successful

[ INFO ] This sample is an API example, for any performance measurements please use the dedicated benchmark_app tool
corrupted double-linked list
Aborted

3.3.4 Results

Parents At First Starbucks Parents Face Detection By Object Detection SSD NCS 1 Parents Face Detection By Object Detection SSD NCS 2
Parents At First Starbucks Parents At First Starbucks - Face Detection By Object Detection SSD NCS 1 Parents At First Starbucks - Face Detection By Object Detection SSD NCS 2
Me Me Face Detection By Object Detection SSD NCS 1 Me Face Detection By OpenCV DNN NCS 2
Me Me - Face Detection By Object Detection SSD NCS 1 Me - Face Detection By Object Detection SSD NCS 2

3.4 Model Optimization

In this section, we are going to test out another OpenVINO example: Image Classification C++ Sample Async. After reading this blog, it wouldn’t be hard for us to notice the MOST important thing we’re missing here is the model file alexnet_fp32.xml. Let’s just keep it in mind for now.

And, let’s review a bit about our previous example: Object Detection – we downloaded face-detection-adas-0001 model from online and use it directly. So, questions:

  • Are we able to download alexnet_fp32.xml from online this time again?
  • Where can we download a whole bunch of open source models?

3.4.1 Open Model Zoo

It wouldn’t be hard for us to google out OpenVINO™ Toolkit - Open Model Zoo repository, under which model face-detection-adas-0001 is just sitting there. However, face-detection-adas-0001.xml and face-detection-adas-0001.bin are missing.

Let’s checkout open_model_zoo and put it under folder /opt/intel.

1
2
3
4
5
6
7
8
➜  intel pwd
/opt/intel
➜ intel ll
total 12K
drwxr-xr-x 8 pi pi 4.0K Apr 7 06:37 dldt
drwxr-xr-x 9 pi pi 4.0K Apr 7 14:04 l_openvino_toolkit_runtime_raspbian_p_2020.1.023
drwxr-xr-x 7 pi pi 4.0K Apr 7 14:04 open_model_zoo
lrwxrwxrwx 1 root root 48 Apr 7 06:29 openvino -> l_openvino_toolkit_runtime_raspbian_p_2020.1.023

Then, let's enter folder face-detection-adas-0001 under open_model_zoo and take a look:

1
2
3
4
➜  face-detection-adas-0001 git:(master) pwd
/opt/intel/open_model_zoo/models/intel/face-detection-adas-0001
➜ face-detection-adas-0001 git:(master) ls
description face-detection-adas-0001.prototxt model.yml

It seems that each folder under intel and public contains the detailed info of each model. For instance, file intel/face-detection-adas-0001/model.yml contains all the info about model face-detection-adas-0001. However, what we really need are a .xml file and a .bin file. In the following, we are going to generate such 2 files, which are optimized specifically for movidius by following Intel OpenVINO toolkit issue 798441.

3.4.2 Download Caffe Model Files

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
➜  downloader git:(master) pwd
/opt/intel/open_model_zoo/tools/downloader
➜ downloader git:(master) ls
caffe2_to_onnx.py converter.py info_dumper.py README.md requirements.in tests
common.py downloader.py pytorch_to_onnx.py requirements-caffe2.in requirements-pytorch.in
➜ downloader git:(master) python downloader.py --name alexnet
################|| Downloading models ||################

========== Downloading /opt/intel/open_model_zoo/tools/downloader/public/alexnet/alexnet.prototxt
... 100%, 3 KB, 10485 KB/s, 0 seconds passed

========== Downloading /opt/intel/open_model_zoo/tools/downloader/public/alexnet/alexnet.caffemodel
... 100%, 238146 KB, 5428 KB/s, 43 seconds passed

################|| Post-processing ||################

========== Replacing text in /opt/intel/open_model_zoo/tools/downloader/public/alexnet/alexnet.prototxt
➜ downloader git:(master) ✗ ll public/alexnet/
total 233M
-rw-r--r-- 1 pi pi 233M Apr 9 14:24 alexnet.caffemodel
-rw-r--r-- 1 pi pi 3.6K Apr 9 14:24 alexnet.prototxt
-rw-r--r-- 1 pi pi 3.6K Apr 9 14:23 alexnet.prototxt.orig

Clearly, three files including a large model file alexnet.caffemodel has been downloaded.

3.4.3 Model Optimization

Now, are are going to optimize the downloaded caffe model and make it feedable to OpenVINO.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
➜  model-optimizer git:(2020) ✗ pwd
/opt/intel/dldt/model-optimizer
➜ model-optimizer git:(2020) ✗ python mo_caffe.py --generate_deprecated_IR_V7 --input_model /opt/intel/open_model_zoo/tools/downloader/public/alexnet/alexnet.caffemodel
[ WARNING ] Use of deprecated cli option --generate_deprecated_IR_V7 detected. Option use in the following releases will be fatal.
Model Optimizer arguments:
Common parameters:
- Path to the Input Model: /opt/intel/open_model_zoo/tools/downloader/public/alexnet/alexnet.caffemodel
- Path for generated IR: /opt/intel/dldt/model-optimizer/.
- IR output name: alexnet
- Log level: ERROR
- Batch: Not specified, inherited from the model
- Input layers: Not specified, inherited from the model
- Output layers: Not specified, inherited from the model
- Input shapes: Not specified, inherited from the model
- Mean values: Not specified
- Scale values: Not specified
- Scale factor: Not specified
- Precision of IR: FP32
- Enable fusing: True
- Enable grouped convolutions fusing: True
- Move mean values to preprocess section: False
- Reverse input channels: False
Caffe specific parameters:
- Path to Python Caffe* parser generated from caffe.proto: mo/front/caffe/proto
- Enable resnet optimization: True
- Path to the Input prototxt: /opt/intel/open_model_zoo/tools/downloader/public/alexnet/alexnet.prototxt
- Path to CustomLayersMapping.xml: Default
- Path to a mean file: Not specified
- Offsets for a mean file: Not specified
Model Optimizer version: unknown version
Please expect that Model Optimizer conversion might be slow. You are currently using Python protobuf library implementation.
However you can use the C++ protobuf implementation that is supplied with the OpenVINO toolkitor build protobuf library from sources.
Navigate to "install_prerequisites" folder and run: python -m easy_install protobuf-3.5.1-py($your_python_version)-win-amd64.egg
set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp


For more information please refer to Model Optimizer FAQ (https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_Model_Optimizer_FAQ.html), question #80.

[ SUCCESS ] Generated IR version 7 model.
[ SUCCESS ] XML file: /opt/intel/dldt/model-optimizer/./alexnet.xml
[ SUCCESS ] BIN file: /opt/intel/dldt/model-optimizer/./alexnet.bin
[ SUCCESS ] Total execution time: 615.36 seconds.
[ SUCCESS ] Memory consumed: 1982 MB.

And, let's take a look at what's generated under folder /opt/intel/dldt/model-optimizer.

1
2
3
4
5
6
7
8
9
10
➜  model-optimizer git:(2020) ✗ pwd
/opt/intel/dldt/model-optimizer
➜ model-optimizer git:(2020) ✗ ls
alexnet.bin extensions mo_caffe.py mo_onnx.py README.md requirements_kaldi.txt requirements_tf.txt
alexnet.mapping install_prerequisites mo_kaldi.py mo.py requirements_caffe.txt requirements_mxnet.txt requirements.txt
alexnet.xml mo mo_mxnet.py mo_tf.py requirements_dev.txt requirements_onnx.txt tf_call_ie_layer
➜ model-optimizer git:(2020) ✗ ll alexnet*
-rw-r--r-- 1 pi pi 233M Apr 9 15:26 alexnet.bin
-rw-r--r-- 1 pi pi 2.6K Apr 9 15:26 alexnet.mapping
-rw-r--r-- 1 pi pi 25K Apr 9 15:26 alexnet.xml

Note: You may meet the following ERRORs during model optimization.

1
2
3
4
[ ERROR ]  
Detected not satisfied dependencies:
networkx: installed: 2.4, required: 2.4
protobuf: installed: 3.11.3, required: 3.6.1

Clearly, for networkx, the ERROR message is a kind of ridiculous. Anyway, if you meet the above 2 errors, please DOWNGRADE your packages as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
➜  ~  pip install protobuf==3.6.1 --user
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting protobuf==3.6.1
Downloading https://files.pythonhosted.org/packages/77/78/a7f1ce761e2c738e209857175cd4f90a8562d1bde32868a8cd5290d58926/protobuf-3.6.1-py2.py3-none-any.whl (390kB)
|████████████████████████████████| 399kB 1.4MB/s
Requirement already satisfied: six>=1.9 in /home/pi/.local/lib/python3.7/site-packages (from protobuf==3.6.1) (1.13.0)
Requirement already satisfied: setuptools in /home/pi/.local/lib/python3.7/site-packages (from protobuf==3.6.1) (44.0.0)
Installing collected packages: protobuf
Found existing installation: protobuf 3.11.3
Uninstalling protobuf-3.11.3:
Successfully uninstalled protobuf-3.11.3
Successfully installed protobuf-3.6.1
➜ ~ pip install networkx==2.3 --user
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting networkx==2.3
Downloading https://files.pythonhosted.org/packages/85/08/f20aef11d4c343b557e5de6b9548761811eb16e438cee3d32b1c66c8566b/networkx-2.3.zip (1.7MB)
|████████████████████████████████| 1.8MB 2.3MB/s
Requirement already satisfied: decorator>=4.3.0 in /home/pi/.local/lib/python3.7/site-packages (from networkx==2.3) (4.4.1)
Building wheels for collected packages: networkx
Building wheel for networkx (setup.py) ... done
Created wheel for networkx: filename=networkx-2.3-py2.py3-none-any.whl size=1556408 sha256=9964dc8e3b41e97f0228afb2c1c6ca40a5dfc07dc1a2574b92717114f3d5e533
Stored in directory: /home/pi/.cache/pip/wheels/de/63/64/3699be2a9d0ccdb37c7f16329acf3863fd76eda58c39c737af
Successfully built networkx
Installing collected packages: networkx
Found existing installation: networkx 2.4
Uninstalling networkx-2.4:
Successfully uninstalled networkx-2.4
Successfully installed networkx-2.3

3.5 Image Classification

3.5.1 C

For NCS 2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
➜  samples ./c/build/armv7l/Release/hello_classification_c /opt/intel/dldt/model-optimizer/alexnet.xml me.jpg HETERO:MYRIAD

Top 10 results:

Image me.jpg

classid probability
------- -----------
838 0.074951
978 0.072632
977 0.072083
975 0.060730
903 0.052948
638 0.040588
976 0.040161
433 0.037842
112 0.032471
639 0.029724
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
➜  samples ./c/build/armv7l/Release/hello_classification_c /opt/intel/dldt/model-optimizer/alexnet.xml parents.jpg HETERO:MYRIAD

Top 10 results:

Image parents.jpg

classid probability
------- -----------
707 0.072144
577 0.024185
704 0.022980
955 0.020844
813 0.020432
910 0.016937
515 0.016235
605 0.013985
918 0.013351
523 0.013031

For NCS 1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
➜  samples ./c/build/armv7l/Release/hello_classification_c /opt/intel/dldt/model-optimizer/alexnet.xml me.jpg HETERO:MYRIAD

Top 10 results:

Image me.jpg

classid probability
------- -----------
978 0.082336
977 0.081665
838 0.081055
975 0.061188
903 0.054840
638 0.046387
433 0.040131
976 0.034607
112 0.032349
639 0.031494
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
➜  samples ./c/build/armv7l/Release/hello_classification_c /opt/intel/dldt/model-optimizer/alexnet.xml parents.jpg HETERO:MYRIAD

Top 10 results:

Image parents.jpg

classid probability
------- -----------
707 0.059418
577 0.026993
813 0.021347
704 0.020218
910 0.019669
515 0.018204
955 0.018051
523 0.013527
808 0.012856
918 0.012802

3.5.2 C++

For NCS 2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
➜  samples ./cpp/build/armv7l/Release/hello_classification /opt/intel/dldt/model-optimizer/alexnet.xml me.jpg HETERO:MYRIAD

Top 10 results:

Image me.jpg

classid probability
------- -----------
838 0.0749512
978 0.0726318
977 0.0720825
975 0.0607300
903 0.0529480
638 0.0405884
976 0.0401611
433 0.0378418
112 0.0324707
639 0.0297241

This sample is an API example, for any performance measurements please use the dedicated benchmark_app tool
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
➜  samples ./cpp/build/armv7l/Release/hello_classification /opt/intel/dldt/model-optimizer/alexnet.xml parents.jpg HETERO:MYRIAD

Top 10 results:

Image parents.jpg

classid probability
------- -----------
707 0.0721436
577 0.0241852
704 0.0229797
955 0.0208435
813 0.0204315
910 0.0169373
515 0.0162354
605 0.0139847
918 0.0133514
523 0.0130310

This sample is an API example, for any performance measurements please use the dedicated benchmark_app tool

For NCS 1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
➜  samples ./cpp/build/armv7l/Release/hello_classification /opt/intel/dldt/model-optimizer/alexnet.xml me.jpg HETERO:MYRIAD               

Top 10 results:

Image me.jpg

classid probability
------- -----------
978 0.0823364
977 0.0816650
838 0.0810547
975 0.0611877
903 0.0548401
638 0.0463867
433 0.0401306
976 0.0346069
112 0.0323486
639 0.0314941

This sample is an API example, for any performance measurements please use the dedicated benchmark_app tool
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
➜  samples ./cpp/build/armv7l/Release/hello_classification /opt/intel/dldt/model-optimizer/alexnet.xml parents.jpg HETERO:MYRIAD

Top 10 results:

Image parents.jpg

classid probability
------- -----------
707 0.0594177
577 0.0269928
813 0.0213470
704 0.0202179
910 0.0196686
515 0.0182037
955 0.0180511
523 0.0135269
808 0.0128555
918 0.0128021

This sample is an API example, for any performance measurements please use the dedicated benchmark_app tool

3.5.3 Python

For NCS 2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
➜  samples python ./python/classification_sample/classification_sample.py -m /opt/intel/dldt/model-optimizer/alexnet.xml -i me.jpg -d HETERO:MYRIAD -nt 10
[ INFO ] Creating Inference Engine
[ INFO ] Loading network files:
/opt/intel/dldt/model-optimizer/alexnet.xml
/opt/intel/dldt/model-optimizer/alexnet.bin
[ INFO ] Preparing input blobs
[ WARNING ] Image me.jpg is resized from (1280, 924) to (227, 227)
[ INFO ] Batch size is 1
[ INFO ] Loading model to the plugin
[ INFO ] Starting inference in synchronous mode
[ INFO ] Processing output blob
[ INFO ] Top 10 results:
Image me.jpg

classid probability
------- -----------
838 0.0751343
978 0.0728149
977 0.0722656
975 0.0606079
903 0.0533142
638 0.0413513
976 0.0391541
433 0.0375061
112 0.0320740
639 0.0298767


[ INFO ] This sample is an API example, for any performance measurements please use the dedicated benchmark_app tool
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
➜  samples python ./python/classification_sample/classification_sample.py -m /opt/intel/dldt/model-optimizer/alexnet.xml -i parents.jpg -d HETERO:MYRIAD -nt 10
[ INFO ] Creating Inference Engine
[ INFO ] Loading network files:
/opt/intel/dldt/model-optimizer/alexnet.xml
/opt/intel/dldt/model-optimizer/alexnet.bin
[ INFO ] Preparing input blobs
[ WARNING ] Image parents.jpg is resized from (960, 1280) to (227, 227)
[ INFO ] Batch size is 1
[ INFO ] Loading model to the plugin
[ INFO ] Starting inference in synchronous mode
[ INFO ] Processing output blob
[ INFO ] Top 10 results:
Image parents.jpg

classid probability
------- -----------
707 0.0712891
577 0.0237122
704 0.0227814
955 0.0209045
813 0.0205231
910 0.0169983
515 0.0162354
605 0.0140991
918 0.0133438
523 0.0129318


[ INFO ] This sample is an API example, for any performance measurements please use the dedicated benchmark_app tool

For NCS 1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
➜  samples python ./python/classification_sample/classification_sample.py -m /opt/intel/dldt/model-optimizer/alexnet.xml -i me.jpg -d HETERO:MYRIAD -nt 10
[ INFO ] Creating Inference Engine
[ INFO ] Loading network files:
/opt/intel/dldt/model-optimizer/alexnet.xml
/opt/intel/dldt/model-optimizer/alexnet.bin
[ INFO ] Preparing input blobs
[ WARNING ] Image me.jpg is resized from (1280, 924) to (227, 227)
[ INFO ] Batch size is 1
[ INFO ] Loading model to the plugin
[ INFO ] Starting inference in synchronous mode
[ INFO ] Processing output blob
[ INFO ] Top 10 results:
Image me.jpg

classid probability
------- -----------
978 0.0818481
977 0.0818481
838 0.0812378
975 0.0610657
903 0.0553894
638 0.0469971
433 0.0398865
976 0.0338440
112 0.0317993
639 0.0317993


[ INFO ] This sample is an API example, for any performance measurements please use the dedicated benchmark_app tool
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
➜  samples python ./python/classification_sample/classification_sample.py -m /opt/intel/dldt/model-optimizer/alexnet.xml -i parents.jpg -d HETERO:MYRIAD -nt 10
[ INFO ] Creating Inference Engine
[ INFO ] Loading network files:
/opt/intel/dldt/model-optimizer/alexnet.xml
/opt/intel/dldt/model-optimizer/alexnet.bin
[ INFO ] Preparing input blobs
[ WARNING ] Image parents.jpg is resized from (960, 1280) to (227, 227)
[ INFO ] Batch size is 1
[ INFO ] Loading model to the plugin
[ INFO ] Starting inference in synchronous mode
[ INFO ] Processing output blob
[ INFO ] Top 10 results:
Image parents.jpg

classid probability
------- -----------
707 0.0590515
577 0.0267334
813 0.0212250
704 0.0199432
910 0.0197906
955 0.0183716
515 0.0182190
523 0.0135040
808 0.0129242
918 0.0126648

3.5.4 Results

Classification Result for me.jpg

Result from NCS 2 Result from NCS 1
838: 'sunscreen, sunblock, sun blocker', 978: 'seashore, coast, seacoast, sea-coast',
978: 'seashore, coast, seacoast, sea-coast', 977: 'sandbar, sand bar',
977: 'sandbar, sand bar', 838: 'sunscreen, sunblock, sun blocker',
975: 'lakeside, lakeshore', 975: 'lakeside, lakeshore',
903: 'wig', 903: 'wig',
638: 'maillot', 638: 'maillot',
976: 'promontory, headland, head, foreland', 433: 'bathing cap, swimming cap',
433: 'bathing cap, swimming cap', 976: 'promontory, headland, head, foreland',
112: 'conch', 112: 'conch',
639: 'maillot, tank suit', 639: 'maillot, tank suit',

Classification Result for parents.jpg

Result from NCS 2 Result from NCS 1
707: 'pay-phone, pay-station', 707: 'pay-phone, pay-station',
577: 'gong, tam-tam', 577: 'gong, tam-tam',
704: 'parking meter', 813: 'spatula',
955: 'jackfruit, jak, jack', 704: 'parking meter',
813: 'spatula', 910: 'wooden spoon',
910: 'wooden spoon', 515: 'cowboy hat, ten-gallon hat',
515: 'cowboy hat, ten-gallon hat', 955: 'jackfruit, jak, jack',
605: 'iPod', 523: 'crutch',
918: 'crossword puzzle, crossword', 808: 'sombrero',
523: 'crutch', 918: 'crossword puzzle, crossword',

classid table:

4. OpenCV DNN with OpenVINO’s Inference Engine

For the example openvino_fd_myriad.py given on Install OpenVINO™ toolkit for Raspbian* OS, the TOUGH thing is how to build OpenCV with OpenVINO’s Inference Engine. NEVER forget to export export InferenceEngine_DIR="/opt/intel/openvino/inference_engine/share" and enable WITH_INF_ENGINE ON to have OpenCV rebuilt. Before moving forward, my modified version of openvino_fd_myriad.py is provided as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import sys, argparse
import cv2

parser = argparse.ArgumentParser(description='OpenVINO Face Detection on MYRIAD')
parser.add_argument('-x', '--XML', help='Required: model XML file')
parser.add_argument('-b', '--BIN', help='Required: model BIN file')
parser.add_argument('-i', '--input', help='Required: input image')
parser.add_argument('-o', '--output', help='Not Required: output resultant image, by default: out.jpg')


args = parser.parse_args()
xmlfile = args.XML
binfile = args.BIN
inputimage = args.input
outputimage = args.output

if not outputimage:
outputimage = "out.jpg"

if not xmlfile:
print(f'openvino_fd_myriad {args.xmlfile}')

if not binfile:
print(f'openvino_fd_myriad {args.binfile}')

if not inputimage:
print(f'openvino_fd_myriad {args.inputimage}')



# Load the model.
net = cv2.dnn.readNet(xmlfile, binfile)
# Specify target device.
net.setPreferableTarget(cv2.dnn.DNN_TARGET_MYRIAD)
# Read an image.
frame = cv2.imread(inputimage)
if frame is None:
raise Exception('Image not found!')
# Prepare input blob and perform an inference.
print("Frame Size: {}".format(frame.shape))
blob = cv2.dnn.blobFromImage(frame, scalefactor=1.0, size=(224, 224), swapRB=True, ddepth=cv2.CV_32F)
net.setInput(blob)
print("First Blob: {}".format(blob.shape))
out = net.forward()
count = 0
# Draw detected faces on the frame.
for detection in out.reshape(-1, 7):
confidence = float(detection[2])
xmin = int(detection[3] * frame.shape[1])
ymin = int(detection[4] * frame.shape[0])
xmax = int(detection[5] * frame.shape[1])
ymax = int(detection[6] * frame.shape[0])
if confidence > 0.8:
cv2.rectangle(frame, (xmin, ymin), (xmax, ymax), color=(0, 255, 0))
count += 1
print(count)
# Save the frame to an image file.
cv2.imwrite(outputimage, frame)

4.1 Intel64

On my laptop, of course, we are building OpenCV for architecture Intel64, with NVidia GPU + CUDA support, for DNN in OpenCV requires either CUDA or OpenCL.

My test result of openvino_fd_myriad.py shows the performance of adopted model face-detection-adas-0001 is NOT as good as expected.

For NCS 2

1
2
3
4
5
6
7
8
➜  OpenVINO_Examples python ./openvino_fd_myriad.py -x /opt/intel/openvino/inference_engine/samples/cpp/build_18.04/intel64/Release/face-detection-adas-0001.xml -b /opt/intel/openvino/inference_engine/samples/cpp/build_18.04/intel64/Release/face-detection-adas-0001.bin -i ./parents.jpg
Frame Size: (960, 1280, 3)
First Blob: (1, 3, 224, 224)
2
➜ OpenVINO_Examples python ./openvino_fd_myriad.py -x /opt/intel/openvino/inference_engine/samples/cpp/build_18.04/intel64/Release/face-detection-adas-0001.xml -b /opt/intel/openvino/inference_engine/samples/cpp/build_18.04/intel64/Release/face-detection-adas-0001.bin -i ./me.jpg
Frame Size: (1280, 924, 3)
First Blob: (1, 3, 224, 224)
1

For NCS 1

1
2
3
4
5
6
7
8
➜  OpenVINO_Examples python ./openvino_fd_myriad.py -x /opt/intel/openvino/inference_engine/samples/cpp/build_18.04/intel64/Release/face-detection-adas-0001.xml -b /opt/intel/openvino/inference_engine/samples/cpp/build_18.04/intel64/Release/face-detection-adas-0001.bin -i ./parents.jpg
Frame Size: (960, 1280, 3)
First Blob: (1, 3, 224, 224)
2
➜ OpenVINO_Examples python ./openvino_fd_myriad.py -x /opt/intel/openvino/inference_engine/samples/cpp/build_18.04/intel64/Release/face-detection-adas-0001.xml -b /opt/intel/openvino/inference_engine/samples/cpp/build_18.04/intel64/Release/face-detection-adas-0001.bin -i ./me.jpg
Frame Size: (1280, 924, 3)
First Blob: (1, 3, 224, 224)
1

Results

Parents At First Starbucks Parents Face Detection By OpenCV DNN NCS 1 Parents Face Detection By OpenCV DNN NCS 2
Parents At First Starbucks Parents At First Starbucks - Face Detection By NCS 1 Parents At First Starbucks - Face Detection By NCS 2
Me Me Face Detection By OpenCV DNN NCS 1 Me Face Detection By OpenCV DNN NCS 2
Me Me - Face Detection By OpenCV DNN NCS 1 Me - Face Detection By OpenCV DNN NCS 2

4.2 armv7l

For NCS 2

1
2
3
4
5
6
7
8
➜  Programs python ./openvino_fd_myriad.py -x /opt/intel/openvino/inference_engine/samples/face-detection-adas-0001.xml -b /opt/intel/openvino/inference_engine/samples/face-detection-adas-0001.bin -i ./parents.jpg
Frame Size: (960, 1280, 3)
First Blob: (1, 3, 224, 224)
2
➜ Programs python ./openvino_fd_myriad.py -x /opt/intel/openvino/inference_engine/samples/face-detection-adas-0001.xml -b /opt/intel/openvino/inference_engine/samples/face-detection-adas-0001.bin -i ./me.jpg
Frame Size: (1280, 924, 3)
First Blob: (1, 3, 224, 224)
1

For NCS 1

1
2
3
4
5
6
7
8
➜  Programs python ./openvino_fd_myriad.py -x /opt/intel/openvino/inference_engine/samples/face-detection-adas-0001.xml -b /opt/intel/openvino/inference_engine/samples/face-detection-adas-0001.bin -i ./parents.jpg
Frame Size: (960, 1280, 3)
First Blob: (1, 3, 224, 224)
2
➜ Programs python ./openvino_fd_myriad.py -x /opt/intel/openvino/inference_engine/samples/face-detection-adas-0001.xml -b /opt/intel/openvino/inference_engine/samples/face-detection-adas-0001.bin -i ./me.jpg
Frame Size: (1280, 924, 3)
First Blob: (1, 3, 224, 224)
1

Results

Parents At First Starbucks Parents Face Detection By OpenCV DNN NCS 1 Parents Face Detection By OpenCV DNN NCS 2
Parents At First Starbucks Parents At First Starbucks - Face Detection By NCS 1 Parents At First Starbucks - Face Detection By NCS 2
Me Me Face Detection By OpenCV DNN NCS 1 Me Face Detection By OpenCV DNN NCS 2
Me Me - Face Detection By OpenCV DNN NCS 1 Me - Face Detection By OpenCV DNN NCS 2

5. My Built Raspbian ISO With OpenCV4 + OpenVINO

Finally, you are welcome to try my built image rpi4-raspbian20200213-opencv4.3-openvino2020.1.023-ncsdk2.10.01.01.img, which is about 9.5G and composed of:

Everything has ALREADY been updated and built successfully, ONLY EXCEPT object_detection_sample_ssd. In addition, rpi4-raspbian20200213-opencv4.3-openvino2020.1.023-ncsdk2.10.01.01.img ALSO works properly on my Raspberry Pi 3 Model B Version 1.2 manufactured in 2015.

This is also an updated version of my previous blog detectron2 published on October 13, 2019. I lost the previous source for this blog, but, let's re-write it.

The autumn in both Vancouver and Seattle is gorgeous…

Overview Seattle on Space Needle Around Space Needle
Overview Seattle on Space Needle Around Space Needle
Space Needle So Heavy
Space Needle So Heavy
Ferris Wheel Pier 55
Ferris Wheel Pier 55
Vancouver Maple UBC Poisonous Mushroom
Vancouver Maple UBC Poisonous Mushroom

Alright, let’s rapidly test Detectron2.

Installation is detailedly summarized in INSTALL.md.

We can simply follow GETTING_STARTED.md for some simple demonstrations. Make sure you’ve downloaded the demo pictures from Detectron1 demo and save under Detectron2’s folder demo.

1
2
3
4
5
6
7
8
9
10
11
➜  detectron2 git:(master) python demo/demo.py --config-file configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml \
--input ./demo/17790319373_bd19b24cfc_k.jpg \
--output ./result.jpg \
--opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl
[04/05 18:17:22 detectron2]: Arguments: Namespace(confidence_threshold=0.5, config_file='configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml', input=['./demo/17790319373_bd19b24cfc_k.jpg'], opts=['MODEL.WEIGHTS', 'detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl'], output='./result.jpg', video_input=None, webcam=False)
[04/05 18:17:24 fvcore.common.checkpoint]: Loading checkpoint from detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl
[04/05 18:17:24 fvcore.common.file_io]: URL https://dl.fbaipublicfiles.com/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl cached in /home/longervision/.torch/fvcore_cache/detectron2/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl
[04/05 18:17:24 fvcore.common.checkpoint]: Reading a file from 'Detectron2 Model Zoo'
0%| | 0/1 [00:00<?, ?it/s][04/05 18:17:25 detectron2]: ./demo/17790319373_bd19b24cfc_k.jpg: detected 13 instances in 0.86s
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1.05it/s]
➜ detectron2 git:(master)

Let's take a look at the result:

Segmentation Result of 17790319373_bd19b24cfc_k

And of course, my pictures taken in Seattle and Vancouver:

Overview Seattle on Space Needle Around Space Needle
Overview Seattle on Space Needle Around Space Needle
Overview Seattle on Space Needle Around Space Needle
Space Needle So Heavy
Overview Seattle on Space Needle Around Space Needle
Ferris Wheel Pier 55
Overview Seattle on Space Needle Around Space Needle
Vancouver Maple UBC Poisonous Mushroom

This is actally an updated version of my previous blog Tensorflow 2.0 published on October 12, 2019. What's unfortunate is: I lost the source of that previous blog. What's fortunate is: I have my Tensorflow updated from 2.0 to 2.1. Anyway, let's begin:

1. Check GPU

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
➜  ~ python
Python 3.6.9 (default, Nov 7 2019, 10:44:02)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from tensorflow.python.client import device_lib
>>> print(device_lib.list_local_devices())
2020-04-16 23:56:44.553741: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE3 SSE4.1 SSE4.2 AVX AVX2 FMA
2020-04-16 23:56:44.579718: I tensorflow/core/platform/profile_utils/cpu_utils.cc:102] CPU Frequency: 2599990000 Hz
2020-04-16 23:56:44.580244: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x58af6e0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-04-16 23:56:44.580285: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2020-04-16 23:56:44.582480: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2020-04-16 23:56:44.627731: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-04-16 23:56:44.628115: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x591d040 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2020-04-16 23:56:44.628133: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): GeForce GTX 980M, Compute Capability 5.2
2020-04-16 23:56:44.628313: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-04-16 23:56:44.628568: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1558] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce GTX 980M computeCapability: 5.2
coreClock: 1.1265GHz coreCount: 12 deviceMemorySize: 3.94GiB deviceMemoryBandwidth: 149.31GiB/s
2020-04-16 23:56:44.628803: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.2
2020-04-16 23:56:44.630300: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10
2020-04-16 23:56:44.631719: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10
2020-04-16 23:56:44.631994: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10
2020-04-16 23:56:44.633648: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10
2020-04-16 23:56:44.634547: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10
2020-04-16 23:56:44.637788: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7
2020-04-16 23:56:44.637974: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-04-16 23:56:44.638283: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-04-16 23:56:44.638528: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1700] Adding visible gpu devices: 0
2020-04-16 23:56:44.638631: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.2
2020-04-16 23:56:44.639308: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1099] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-04-16 23:56:44.639318: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1105] 0
2020-04-16 23:56:44.639342: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1118] 0: N
2020-04-16 23:56:44.639477: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-04-16 23:56:44.639759: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-04-16 23:56:44.640041: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1244] Created TensorFlow device (/device:GPU:0 with 165 MB memory) -> physical GPU (device: 0, name: GeForce GTX 980M, pci bus id: 0000:01:00.0, compute capability: 5.2)
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 5137338600707339983
, name: "/device:XLA_CPU:0"
device_type: "XLA_CPU"
memory_limit: 17179869184
locality {
}
incarnation: 3339260717563932836
physical_device_desc: "device: XLA_CPU device"
, name: "/device:XLA_GPU:0"
device_type: "XLA_GPU"
memory_limit: 17179869184
locality {
}
incarnation: 15541604922692464209
physical_device_desc: "device: XLA_GPU device"
, name: "/device:GPU:0"
device_type: "GPU"
memory_limit: 173539328
locality {
bus_id: 1
links {
}
}
incarnation: 5921365879699198963
physical_device_desc: "device: 0, name: GeForce GTX 980M, pci bus id: 0000:01:00.0, compute capability: 5.2"
]

Then, for simplicity, let’s try it out directly:

2. Tensorflow 2.X

3. Tensorflow Dataset

Hello everyone… As you all know that currently, my hometown Wuhan, China is suffering the MOST SERIOUS infectious disease - Corona Virus in her history. My parents are still in this locked city. People have been suffering the threaten from the death for over 20 days. I would have to write something, and WISH ALL MY BEST to my beloved parents, and all my country fellows who are still in Wuhan.

In this blog, all data are obtained from WHO Corona Virus Reports. And, all plots are generated by altair.

So far, I can ONLY make that much…

Confirmed Cases In China Death Over The World
Confirmed Cases In China Death Over The World

God bless Dr. Li WenLiang, and shame on rubbish in Chinese government.

Updated on:

  • February 10, 2020
  • February 14, 2020
  • February 15, 2020
  • February 16, 2020
  • February 17, 2020
  • February 19, 2020
  • February 21, 2020 So far, the data is still lack of info such as age, gender, etc. Let’s keep an eye on Corona Virus.


I tried HiKey970 half a year ago, but NOT quite focused on it. There seems to be NO good operating system for this particular board. During this god-damn-it COVID-19, I now have some time, and seriously would like to fullfill some of my ideas on this particular 96board:

1. Hackerboards Comparisons

1.1 HiKey970 vs Hikey960

Hisilicon's official products' website provides a detailed comparison of these two open source boards.

By far, HiKey970 is exactly the most powerful edge computing SBC I've ever met.

It looks HackerBoards has done a thorough comparison of almost all types of SBCs. Let's just select the boards that we're interested in and carry out our comparison. Clearly, HiKey970's performance is outstanding.

2. Build Our Own OS For HiKey970

2.1 Set up Cross_Compiler

1
2
3
4
5
6
➜  ~ export CC="aarch64-linux-gnu-"
➜ ~ ${CC}gcc --version
aarch64-linux-gnu-gcc (Ubuntu 9.3.0-10ubuntu1) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

3. Flash HiKey970

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
➜  binaries sudo ./hikey_idt -c config
Config name: config
0: Image: ./sec_usb_xloader.img Downalod Address: 0x22000
1: Image: ./sec_usb_xloader2.img Downalod Address: 0x60049000
2: Image: ./l-loader.bin Downalod Address: 0x16800000
Serial port open successfully!
Start downloading ./sec_usb_xloader.img@0x22000...
file total size 122880
downlaod address 0x22000
Finish downloading
Start downloading ./sec_usb_xloader2.img@0x60049000...
file total size 40960
downlaod address 0x60049000
Finish downloading
Start downloading ./l-loader.bin@0x16800000...
file total size 1179648
downlaod address 0x16800000
Finish downloading
➜ binaries cd ../
➜ Hikey970-shunya-desktop-image-0.1 sudo ./binaries/recovery-flash.sh
./binaries/recovery-flash.sh: 7: [: unexpected operator
Config name: ....../Hikey970-shunya-desktop-image-0.1/binaries/config
....../Hikey970-shunya-desktop-image-0.1/binaries/hikey_idt: option requires an argument -- 'p'
Usage: hikey_idt -c config
Flashing ptable
Sending 'ptable' (24 KB) OKAY [ 0.001s]
Writing 'ptable' OKAY [ 0.005s]
Finished. Total time: 0.007s
Sending 'xloader' (164 KB) OKAY [ 0.005s]
Writing 'xloader' OKAY [ 0.009s]
Finished. Total time: 0.014s
Sending 'fastboot' (1152 KB) OKAY [ 0.034s]
Writing 'fastboot' OKAY [ 0.056s]
Finished. Total time: 0.091s
Sending 'fip' (1224 KB) OKAY [ 0.036s]
Writing 'fip' OKAY [ 0.058s]
Finished. Total time: 0.098s
Sending 'boot' (65536 KB) OKAY [ 2.143s]
Writing 'boot' OKAY [ 0.418s]
Finished. Total time: 2.590s
Please be patient...
Sending sparse 'userdata' 1/6 (131068 KB) OKAY [ 5.894s]
Writing 'userdata' OKAY [ 0.674s]
Sending sparse 'userdata' 2/6 (131068 KB) OKAY [ 4.250s]
Writing 'userdata' OKAY [ 0.740s]
Sending sparse 'userdata' 3/6 (131068 KB) OKAY [ 4.039s]
Writing 'userdata' OKAY [ 0.687s]
Sending sparse 'userdata' 4/6 (131068 KB) OKAY [ 4.029s]
Writing 'userdata' OKAY [ 0.670s]
Sending sparse 'userdata' 5/6 (131068 KB) OKAY [ 3.526s]
Writing 'userdata' OKAY [ 0.672s]
Sending sparse 'userdata' 6/6 (66608 KB) OKAY [ 1.827s]
Writing 'userdata' OKAY [ 0.346s]
Finished. Total time: 27.425s

4. Conclusion

If:

Today, we’re going to build our own toolchain using crosstool-NG. There are so many cases that we want to build a particular toolchain for a specific embedded system development board. One MOST important reason for that is probably because the specific development board has limited resource to build upon, therefore, the time-consumption to build some software on the development board is VERY inefficient. In the other way around, cross compiling on the host PC is MORE efficient with respective to the time-consumption.

In this blog, for simplicity, we take Raspberry Pi 3B as our demo development board, for which we are building the cross compiler. Some references can be found at:

1. Installation

How to install crosstool-NG are thoroughly summarized at its official website. In my case, I had it installed under folder /opt/compilers/crosstool-ng. Let’s take a look:

1
2
3
4
5
6
longervision-GT72-6QE% pwd
/opt/compilers/crosstool-ng
longervision-GT72-6QE% ls
bin libexec share
longervision-GT72-6QE% ls bin
ct-ng

And make sure /opt/compilers/crosstool-ng/bin is under environment variable PATH.

2. Configuration

Under any directory that you want to save your .config file, we can configure our target cross compiler.

1
longervision-GT72-6QE% ct-ng menuconfig
crosstool-NG menuconfig

According to elinux: RPi Linaro GCC Compilation, we need to do the following selections:

  • Paths and misc options:
    • Try features marked as EXPERIMENTAL: ticked
    • Prefix directory: input the full path where you want to save the built toolchains
    • Number of parallel jobs: 4. Sorry that I’ve NO idea if this is the number of cores on Raspberry Pi 3B, but Raspberry Pi 3B does have 4 cores.
  • Target options:
    • Target Architecture: arm
    • Default instruction set mode: arm
    • Use EABI: ticked
    • append hf to the tuple (EXPERIMENTAL): ticked
    • Endianness: Little endian
    • Bitness: 32-bit
    • Emit assembly for CPU: cortex-a53
    • Use specific FPU: vfp
    • Floating point: hardware (FPU)
  • Toolchain options:
    • Tuple’s vendor string: rpi
  • Operating System
1
2
➜  ~ uname -a
Linux raspberrypi 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux
  • Binary utilities:
    • Binary format: ELF
    • Version of binutils: 2.31.1
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      ➜  ~ apt show binutils
      Package: binutils
      Version: 2.31.1-16+rpi1
      Priority: optional
      Section: devel
      Maintainer: Matthias Klose <doko@debian.org>
      Installed-Size: 95.2 kB
      Provides: binutils-gold, elf-binutils
      Depends: binutils-common (= 2.31.1-16+rpi1), libbinutils (= 2.31.1-16+rpi1), binutils-arm-linux-gnueabihf (= 2.31.1-16+rpi1)
      Suggests: binutils-doc (>= 2.31.1-16+rpi1)
      Conflicts: binutils-multiarch (<< 2.27-8), modutils (<< 2.4.19-1)
      Homepage: https://www.gnu.org/software/binutils/
      Download-Size: 56.9 kB
      APT-Manual-Installed: no
      APT-Sources: http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
      Description: GNU assembler, linker and binary utilities
      The programs in this package are used to assemble, link and manipulate
      binary and object files. They may be used in conjunction with a compiler
      and various libraries to build programs.
  • C-library:
    • C library: glibc
    • Version of glibc: 2.28
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      ➜  ~ apt show libc-bin
      Package: libc-bin
      Version: 2.28-10+rpi1
      Priority: required
      Essential: yes
      Section: libs
      Source: glibc
      Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
      Installed-Size: 3,015 kB
      Depends: libc6 (>> 2.28), libc6 (<< 2.29)
      Recommends: manpages
      Homepage: https://www.gnu.org/software/libc/libc.html
      Download-Size: 657 kB
      APT-Manual-Installed: yes
      APT-Sources: http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
      Description: GNU C Library: Binaries
      This package contains utility programs related to the GNU C Library.
      .
      * catchsegv: catch segmentation faults in programs
      * getconf: query system configuration variables
      * getent: get entries from administrative databases
      * iconv, iconvconfig: convert between character encodings
      * ldd, ldconfig: print/configure shared library dependencies
      * locale, localedef: show/generate locale definitions
      * tzselect, zdump, zic: select/dump/compile time zones
  • C compiler:
    • Show gcc versions from: GNU
    • Version of gcc: 8.3.0
    • gcc extra config: --with-float=hard
    • Link libstdc++ statically into the gcc binary: tick
    • C++: tick
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      ➜  ~ apt show gcc
      Package: gcc
      Version: 4:8.3.0-1+rpi2
      Priority: optional
      Section: devel
      Source: gcc-defaults (1.181+rpi2)
      Maintainer: Debian GCC Maintainers <debian-gcc@lists.debian.org>
      Installed-Size: 46.1 kB
      Provides: c-compiler, gcc-arm-linux-gnueabihf (= 4:8.3.0-1+rpi2)
      Depends: cpp (= 4:8.3.0-1+rpi2), gcc-8 (>= 8.3.0-1~)
      Recommends: libc6-dev | libc-dev
      Suggests: gcc-multilib, make, manpages-dev, autoconf, automake, libtool, flex, bison, gdb, gcc-doc
      Conflicts: gcc-doc (<< 1:2.95.3)
      Download-Size: 5,200 B
      APT-Manual-Installed: no
      APT-Sources: http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
      Description: GNU C compiler
      This is the GNU C compiler, a fairly portable optimizing compiler for C.
      .
      This is a dependency package providing the default GNU C compiler.

After we save the configuration to file .config, we Exit the crosstool-NG configuration dialog.

3. Build

Please remember to:

  • unset LD_LIBRARY_PATH before building. Otherwise, you’ll meet some ERROR messages.
  • mkdir ~/src before building. Otherwise, whenever you tried to rerun ct-ng build, you’ll have to download ALL required packages from scratch.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
longervision-GT72-6QE% ct-ng build
[INFO ] Performing some trivial sanity checks
[WARN ] Number of open files 1024 may not be sufficient to build the toolchain; increasing to 2048
[INFO ] Build started 20190906.014128
[INFO ] Building environment variables
[EXTRA] Preparing working directories
[EXTRA] Installing user-supplied crosstool-NG configuration
[EXTRA] =================================================================
[EXTRA] Dumping internal crosstool-NG configuration
[EXTRA] Building a toolchain for:
[EXTRA] build = x86_64-pc-linux-gnu
[EXTRA] host = x86_64-pc-linux-gnu
[EXTRA] target = arm-rpi-linux-gnueabihf
[EXTRA] Dumping internal crosstool-NG configuration: done in 0.07s (at 00:01)
[INFO ] =================================================================
[INFO ] Retrieving needed toolchain components' tarballs
[EXTRA] Retrieving 'ncurses-6.1'
[EXTRA] Verifying SHA512 checksum for 'ncurses-6.1.tar.gz'
[EXTRA] Saving 'ncurses-6.1.tar.gz' to local storage
[EXTRA] Retrieving 'libiconv-1.15'
[EXTRA] Verifying SHA512 checksum for 'libiconv-1.15.tar.gz'
[EXTRA] Saving 'libiconv-1.15.tar.gz' to local storage
[EXTRA] Retrieving 'gettext-0.19.8.1'
[EXTRA] Verifying SHA512 checksum for 'gettext-0.19.8.1.tar.xz'
[EXTRA] Saving 'gettext-0.19.8.1.tar.xz' to local storage
[EXTRA] Retrieving 'binutils-2.31.1'
[EXTRA] Verifying SHA512 checksum for 'binutils-2.31.1.tar.xz'
[EXTRA] Saving 'binutils-2.31.1.tar.xz' to local storage
[EXTRA] Retrieving 'gcc-8.3.0'
[EXTRA] Verifying SHA512 checksum for 'gcc-8.3.0.tar.xz'
[EXTRA] Saving 'gcc-8.3.0.tar.xz' to local storage
[EXTRA] Retrieving 'glibc-2.28'
[EXTRA] Verifying SHA512 checksum for 'glibc-2.28.tar.xz'
[EXTRA] Saving 'glibc-2.28.tar.xz' to local storage
[INFO ] Retrieving needed toolchain components' tarballs: done in 130.35s (at 02:12)
[INFO ] =================================================================
[INFO ] Extracting and patching toolchain components
[EXTRA] Extracting linux-4.20.8
[EXTRA] Patching linux-4.20.8
[EXTRA] Extracting zlib-1.2.11
[EXTRA] Patching zlib-1.2.11
[EXTRA] Extracting gmp-6.1.2
[EXTRA] Patching gmp-6.1.2
[EXTRA] Extracting mpfr-4.0.2
[EXTRA] Patching mpfr-4.0.2
[EXTRA] Extracting isl-0.20
[EXTRA] Patching isl-0.20
[EXTRA] Extracting mpc-1.1.0
[EXTRA] Patching mpc-1.1.0
[EXTRA] Extracting ncurses-6.1
[EXTRA] Patching ncurses-6.1
[EXTRA] Extracting libiconv-1.15
[EXTRA] Patching libiconv-1.15
[EXTRA] Extracting gettext-0.19.8.1
[EXTRA] Patching gettext-0.19.8.1
[EXTRA] Extracting binutils-2.31.1
[EXTRA] Patching binutils-2.31.1
[EXTRA] Extracting gcc-8.3.0
[EXTRA] Patching gcc-8.3.0
[EXTRA] Extracting glibc-2.28
[EXTRA] Patching glibc-2.28
[INFO ] Extracting and patching toolchain components: done in 33.39s (at 02:45)
[INFO ] =================================================================
[INFO ] Installing ncurses for build
[EXTRA] Configuring ncurses
[EXTRA] Building ncurses
[EXTRA] Installing ncurses
[INFO ] Installing ncurses for build: done in 14.62s (at 03:00)
[INFO ] =================================================================
[INFO ] Installing zlib for host
[EXTRA] Configuring zlib
[EXTRA] Building zlib
[EXTRA] Installing zlib
[INFO ] Installing zlib for host: done in 1.12s (at 03:01)
[INFO ] =================================================================
[INFO ] Installing GMP for host
[EXTRA] Configuring GMP
[EXTRA] Building GMP
[EXTRA] Installing GMP
[INFO ] Installing GMP for host: done in 30.12s (at 03:31)
[INFO ] =================================================================
[INFO ] Installing MPFR for host
[EXTRA] Configuring MPFR
[EXTRA] Building MPFR
[EXTRA] Installing MPFR
[INFO ] Installing MPFR for host: done in 17.35s (at 03:48)
[INFO ] =================================================================
[INFO ] Installing ISL for host
[EXTRA] Configuring ISL
[EXTRA] Building ISL
[EXTRA] Installing ISL
[INFO ] Installing ISL for host: done in 17.73s (at 04:06)
[INFO ] =================================================================
[INFO ] Installing MPC for host
[EXTRA] Configuring MPC
[EXTRA] Building MPC
[EXTRA] Installing MPC
[INFO ] Installing MPC for host: done in 5.47s (at 04:12)
[INFO ] =================================================================
[INFO ] Installing ncurses for host
[EXTRA] Configuring ncurses
[EXTRA] Building ncurses
[EXTRA] Installing ncurses
[INFO ] Installing ncurses for host: done in 13.64s (at 04:25)
[INFO ] =================================================================
[INFO ] Installing libiconv for host
[EXTRA] Skipping (included in GNU C library)
[INFO ] Installing libiconv for host: done in 0.01s (at 04:25)
[INFO ] =================================================================
[INFO ] Installing gettext for host
[EXTRA] Skipping (included in GNU C library)
[INFO ] Installing gettext for host: done in 0.01s (at 04:25)
[INFO ] =================================================================
[INFO ] Installing binutils for host
[EXTRA] Configuring binutils
[EXTRA] Building binutils
[EXTRA] Installing binutils
[INFO ] Installing binutils for host: done in 46.89s (at 05:12)
[INFO ] =================================================================
[INFO ] Installing pass-1 core C gcc compiler
[EXTRA] Configuring core C gcc compiler
[EXTRA] Building gcc
[EXTRA] Installing gcc
[EXTRA] Housekeeping for core gcc compiler
[EXTRA] '' --> lib (gcc) lib (os)
[INFO ] Installing pass-1 core C gcc compiler: done in 285.36s (at 09:58)
[INFO ] =================================================================
[INFO ] Installing kernel headers
[EXTRA] Installing kernel headers
[EXTRA] Checking installed headers
[INFO ] Installing kernel headers: done in 6.47s (at 10:04)
[INFO ] =================================================================
[INFO ] Installing C library headers & start files
[INFO ] =================================================================
[INFO ] Building for multilib 1/1: ''
[EXTRA] Configuring C library
[EXTRA] Installing C library headers
[EXTRA] Installing C library start files
[INFO ] Building for multilib 1/1: '': done in 7.65s (at 10:12)
[INFO ] Installing C library headers & start files: done in 7.72s (at 10:12)
[INFO ] =================================================================
[INFO ] Installing pass-2 core C gcc compiler
[EXTRA] Configuring core C gcc compiler
[EXTRA] Building gcc
[EXTRA] Installing gcc
[EXTRA] Housekeeping for core gcc compiler
[EXTRA] '' --> lib (gcc) lib (os)
[INFO ] Installing pass-2 core C gcc compiler: done in 354.87s (at 16:07)
[INFO ] =================================================================
[INFO ] Installing C library
[INFO ] =================================================================
[INFO ] Building for multilib 1/1: ''
[EXTRA] Cleaning up start files
[EXTRA] Configuring C library
[EXTRA] Building C library
[EXTRA] Configuring C library
[EXTRA] Building C library
[EXTRA] Installing C library
[INFO ] Building for multilib 1/1: '': done in 184.69s (at 19:12)
[INFO ] Installing C library: done in 184.78s (at 19:12)
[INFO ] =================================================================
[INFO ] Installing final gcc compiler
[EXTRA] Configuring final gcc compiler
[EXTRA] Building final gcc compiler
[EXTRA] Installing final gcc compiler
[EXTRA] Housekeeping for final gcc compiler
[EXTRA] '' --> lib (gcc) lib (os)
[INFO ] Installing final gcc compiler: done in 339.13s (at 24:51)
[INFO ] =================================================================
[INFO ] Finalizing the toolchain's directory
[INFO ] Stripping all toolchain executables
[EXTRA] Installing the populate helper
[EXTRA] Installing a cross-ldd helper
[EXTRA] Creating toolchain aliases
[EXTRA] Removing installed documentation
[EXTRA] Collect license information from: ~/Crosscompile/.build/arm-rpi-linux-gnueabihf/src
[EXTRA] Put the license information to: ~/....../RPi/share/licenses
[INFO ] Finalizing the toolchain's directory: done in 1.80s (at 24:52)
[INFO ] Build completed at 20190906.020619
[INFO ] (elapsed: 24:51.86)
[INFO ] Finishing installation (may take a few seconds)...
[24:52] / % longervision-GT72-6QE%

This process may take a while. I’m going to sleep tonight. Continue tomorrow…

Alright, let’s continue today. Glad to know it’s built successfully.

😄

Let’s FIRST take a look at what’s under the current folder.

1
2
longervision-GT72-6QE% ls
build.log rpi.config

And then, let’s take a look at what’s built under the specified destination folder.

1
2
3
4
5
6
7
8
9
10
longervision-GT72-6QE% ls ~/....../CrossCompile/RPi
arm-rpi-linux-gnueabihf bin build.log.bz2 include lib libexec share
longervision-GT72-6QE% ls ~/....../CrossCompile/RPi/bin
arm-rpi-linux-gnueabihf-addr2line arm-rpi-linux-gnueabihf-cpp arm-rpi-linux-gnueabihf-gcc-ar arm-rpi-linux-gnueabihf-gprof arm-rpi-linux-gnueabihf-objdump arm-rpi-linux-gnueabihf-strip
arm-rpi-linux-gnueabihf-ar arm-rpi-linux-gnueabihf-ct-ng.config arm-rpi-linux-gnueabihf-gcc-nm arm-rpi-linux-gnueabihf-ld arm-rpi-linux-gnueabihf-populate
arm-rpi-linux-gnueabihf-as arm-rpi-linux-gnueabihf-elfedit arm-rpi-linux-gnueabihf-gcc-ranlib arm-rpi-linux-gnueabihf-ld.bfd arm-rpi-linux-gnueabihf-ranlib
arm-rpi-linux-gnueabihf-c++ arm-rpi-linux-gnueabihf-g++ arm-rpi-linux-gnueabihf-gcov arm-rpi-linux-gnueabihf-ldd arm-rpi-linux-gnueabihf-readelf
arm-rpi-linux-gnueabihf-cc arm-rpi-linux-gnueabihf-gcc arm-rpi-linux-gnueabihf-gcov-dump arm-rpi-linux-gnueabihf-nm arm-rpi-linux-gnueabihf-size
arm-rpi-linux-gnueabihf-c++filt arm-rpi-linux-gnueabihf-gcc-8.3.0 arm-rpi-linux-gnueabihf-gcov-tool arm-rpi-linux-gnueabihf-objcopy arm-rpi-linux-gnueabihf-strings
longervision-GT72-6QE%

Finally, let’s take a look at the version of our built cross compilers for Raspberry Pi 3B.

1
2
3
4
5
6
7
8
9
10
11
12
13
longervision-GT72-6QE% arm-rpi-linux-gnueabihf-gcc --version
zsh: command not found: arm-rpi-linux-gnueabihf-gcc
longervision-GT72-6QE% ./arm-rpi-linux-gnueabihf-gcc --version
arm-rpi-linux-gnueabihf-gcc (crosstool-NG 1.24.0.6-afaf7b9) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

longervision-GT72-6QE% ./arm-rpi-linux-gnueabihf-g++ --version
arm-rpi-linux-gnueabihf-g++ (crosstool-NG 1.24.0.6-afaf7b9) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Additional issue: It seems current crosstool-NG does NOT officially support Python. Please refer to my issue at crosstool-NG.

4. Compile/Build a Package with Generated Toolchain

For most of the packages nowadays, they are

  • either supported by make: ./configure -> make -> make install
  • or supported by CMake: mkdir build -> cd build -> ccmake ../ -> make -> make install

How to use our generated toolchain to compile/build our target packages?

Today, we’re going to take the package flann as an example, which are to be built with CMake.

4.1 CMakeLists.txt Modification

4.1.1 CMake Toolchains - Cross Compiling for Linux

By following CMake Toolchains - Cross Compiling for Linux, we FIRST modify flann CMakeLists.txt a bit by adding the following lines before project(flann).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
cmake_minimum_required(VERSION 2.6)

if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)

set(CMAKE_SYSROOT ....../arm-rpi-linux-gnueabihf/sysroot)
set(CMAKE_STAGING_PREFIX ....../stage)

set(tools /opt/compilers/RPi)
set(CMAKE_C_COMPILER ${tools}/bin/arm-rpi-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER ${tools}/bin/arm-rpi-linux-gnueabihf-g++)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")

project(flann)
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
  • CMAKE_SYSROOT specify the sysroot directory which emulate your target environment, here, Raspberry Pi 3B
  • CMAKE_STAGING_PREFIX is where the STAGING results store, for the reason that final results may require to be built in multiple stages. You may refer to Linux From Scratch for further background knowledge about that.
  • tools actually specify the building tool directory. Making sure all generated cross compiling tools are under folder ${tools}/bin.

4.1.2 Ignore hdf5

In addition, for the emulated Raspberry Pi 3B sysroot, hdf5 is NOT supported. Therefore, let’s simply comment out the following line in flann CMakeLists.txt.

1
#find_hdf5()

4.2 Cross Compile

Now, let’s start cross-compiling flann.

1
2
3
longervision-GT72-6QE% mkdir build
longervision-GT72-6QE% cd build
longervision-GT72-6QE% ccmake ../

and press c and then t, you’ll see the cross compiling toolchains have been automatically configured as:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
BUILD_CUDA_LIB                  *OFF
BUILD_C_BINDINGS *ON
BUILD_DOC *OFF
BUILD_EXAMPLES *OFF
BUILD_MATLAB_BINDINGS *OFF
BUILD_PYTHON_BINDINGS *ON
BUILD_TESTS *OFF
CMAKE_AR */opt/compilers/RPi/bin/arm-rpi-linux-gnueabihf-ar
CMAKE_BUILD_TYPE *RelWithDebInfo
CMAKE_COLOR_MAKEFILE *ON
CMAKE_CXX_COMPILER_AR */opt/compilers/RPi/bin/arm-rpi-linux-gnueabihf-gcc-ar
CMAKE_CXX_COMPILER_RANLIB */opt/compilers/RPi/bin/arm-rpi-linux-gnueabihf-gcc-ranlib
CMAKE_CXX_FLAGS *-I/usr/include
CMAKE_CXX_FLAGS_DEBUG *-g
CMAKE_CXX_FLAGS_MINSIZEREL *-Os -DNDEBUG
CMAKE_CXX_FLAGS_RELEASE *-O3 -DNDEBUG
CMAKE_CXX_FLAGS_RELWITHDEBINFO *-O2 -g -DNDEBUG
CMAKE_C_COMPILER_AR */opt/compilers/RPi/bin/arm-rpi-linux-gnueabihf-gcc-ar
CMAKE_C_COMPILER_RANLIB */opt/compilers/RPi/bin/arm-rpi-linux-gnueabihf-gcc-ranlib
CMAKE_C_FLAGS *-I/usr/include
CMAKE_C_FLAGS_DEBUG *-g
CMAKE_C_FLAGS_MINSIZEREL *-Os -DNDEBUG
CMAKE_C_FLAGS_RELEASE *-O3 -DNDEBUG
CMAKE_C_FLAGS_RELWITHDEBINFO *-O2 -g -DNDEBUG
CMAKE_EXE_LINKER_FLAGS *
CMAKE_EXE_LINKER_FLAGS_DEBUG *
CMAKE_EXE_LINKER_FLAGS_MINSIZE *
CMAKE_EXE_LINKER_FLAGS_RELEASE *
CMAKE_EXE_LINKER_FLAGS_RELWITH *
CMAKE_EXPORT_COMPILE_COMMANDS *OFF
CMAKE_INSTALL_PREFIX */usr/local
CMAKE_LINKER */opt/compilers/RPi/bin/arm-rpi-linux-gnueabihf-ld
CMAKE_MAKE_PROGRAM */usr/bin/make
CMAKE_MODULE_LINKER_FLAGS *
CMAKE_MODULE_LINKER_FLAGS_DEBU *
CMAKE_MODULE_LINKER_FLAGS_MINS *
CMAKE_MODULE_LINKER_FLAGS_RELE *
CMAKE_MODULE_LINKER_FLAGS_RELW *
CMAKE_NM */opt/compilers/RPi/bin/arm-rpi-linux-gnueabihf-nm
CMAKE_OBJCOPY */opt/compilers/RPi/bin/arm-rpi-linux-gnueabihf-objcopy
CMAKE_OBJDUMP */opt/compilers/RPi/bin/arm-rpi-linux-gnueabihf-objdump
CMAKE_RANLIB */opt/compilers/RPi/bin/arm-rpi-linux-gnueabihf-ranlib
CMAKE_SHARED_LINKER_FLAGS *
CMAKE_SHARED_LINKER_FLAGS_DEBU *
CMAKE_SHARED_LINKER_FLAGS_MINS *
CMAKE_SHARED_LINKER_FLAGS_RELE *
CMAKE_SHARED_LINKER_FLAGS_RELW *
CMAKE_SKIP_INSTALL_RPATH *OFF
CMAKE_SKIP_RPATH *OFF
CMAKE_STATIC_LINKER_FLAGS *
CMAKE_STATIC_LINKER_FLAGS_DEBU *
CMAKE_STATIC_LINKER_FLAGS_MINS *
CMAKE_STATIC_LINKER_FLAGS_RELE *
CMAKE_STATIC_LINKER_FLAGS_RELW *
CMAKE_STRIP */opt/compilers/RPi/bin/arm-rpi-linux-gnueabihf-strip
CMAKE_VERBOSE_MAKEFILE *ON
CPACK_SOURCE_RPM *OFF
CPACK_SOURCE_TBZ2 *ON
CPACK_SOURCE_TGZ *ON
CPACK_SOURCE_TXZ *ON
CPACK_SOURCE_TZ *ON
CPACK_SOURCE_ZIP *OFF
DPKG_PROGRAM */usr/bin/dpkg
NSIS_PROGRAM */usr/bin/makensis
NVCC_COMPILER_BINDIR *
PACKAGE_MAKER_PROGRAM *PACKAGE_MAKER_PROGRAM-NOTFOUND
PKG_CONFIG_EXECUTABLE */usr/bin/pkg-config
PYTHON_EXECUTABLE */usr/bin/python
RPM_PROGRAM *RPM_PROGRAM-NOTFOUND
USE_MPI *OFF
USE_OPENMP *OFF

The LAST step before make is to modify some of the parameters accordingly, in my case:

  • BUILD_PYTHON_BINDINGS: ON -> OFF
  • CMAKE_CXX_FLAGS: -I/usr/include (for lz4.h from my host Ubuntu 19.04)
  • CMAKE_C_FLAGS: -I/usr/include (for lz4.h from my host Ubuntu 19.04)
  • CMAKE_VERBOSE_MAKEFILE: OFF -> ON
  • CMAKE_INSTALL_PREFIX: /usr/local/ -> under which directory you want to install, which can be IGNORED for now

Now, press c, you’ll see:

1
2
CMake Warning at CMakeLists.txt:99 (message):
hdf5 library not found, some tests will not be run

A warining of missing hdf5 is clearly reasonable and acceptable. Then press g.

Finally, it’s the time for us to cross build flann.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
longervision-GT72-6QE% make -j8
/usr/bin/cmake -S....../flann -B....../flann/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start ....../flann/build/CMakeFiles ....../flann/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '....../flann/build'
make -f src/cpp/CMakeFiles/flann_s.dir/build.make src/cpp/CMakeFiles/flann_s.dir/depend
make -f src/cpp/CMakeFiles/flann_cpp_s.dir/build.make src/cpp/CMakeFiles/flann_cpp_s.dir/depend
make[2]: Entering directory '....../flann/build'
cd ....../flann/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" ....../flann ....../flann/src/cpp ....../flann/build ....../flann/build/src/cpp ....../flann/build/src/cpp/CMakeFiles/flann_s.dir/DependInfo.cmake --color=
make[2]: Entering directory '....../flann/build'
cd ....../flann/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" ....../flann ....../flann/src/cpp ....../flann/build ....../flann/build/src/cpp ....../flann/build/src/cpp/CMakeFiles/flann_cpp_s.dir/DependInfo.cmake --color=
Scanning dependencies of target flann_cpp_s
make[2]: Leaving directory '....../flann/build'
make -f src/cpp/CMakeFiles/flann_s.dir/build.make src/cpp/CMakeFiles/flann_s.dir/build
make[2]: Entering directory '....../flann/build'
make[2]: Leaving directory '....../flann/build'
make -f src/cpp/CMakeFiles/flann_cpp_s.dir/build.make src/cpp/CMakeFiles/flann_cpp_s.dir/build
make[2]: Entering directory '....../flann/build'
[ 12%] Building CXX object src/cpp/CMakeFiles/flann_s.dir/flann/flann.cpp.o
cd ....../flann/build/src/cpp && /opt/compilers/RPi/bin/arm-rpi-linux-gnueabihf-g++ --sysroot=....../RPi/arm-rpi-linux-gnueabihf/sysroot -DFLANN_STATIC -D_FLANN_VERSION=1.9.1 -I....../flann/src/cpp -I/usr/include -O2 -g -DNDEBUG -Wall -Wno-unknown-pragmas -Wno-unused-function -fPIC -o CMakeFiles/flann_s.dir/flann/flann.cpp.o -c ....../flann/src/cpp/flann/flann.cpp
[ 25%] Building CXX object src/cpp/CMakeFiles/flann_cpp_s.dir/flann/flann_cpp.cpp.o
cd ....../flann/build/src/cpp && /opt/compilers/RPi/bin/arm-rpi-linux-gnueabihf-g++ --sysroot=....../RPi/arm-rpi-linux-gnueabihf/sysroot -DFLANN_STATIC -DFLANN_USE_CUDA -D_FLANN_VERSION=1.9.1 -I....../flann/src/cpp -I/usr/include -O2 -g -DNDEBUG -Wall -Wno-unknown-pragmas -Wno-unused-function -fPIC -o CMakeFiles/flann_cpp_s.dir/flann/flann_cpp.cpp.o -c ....../flann/src/cpp/flann/flann_cpp.cpp
In file included from ....../flann/src/cpp/flann/util/params.h:33,
from ....../flann/src/cpp/flann/flann.hpp:42,
from ....../flann/src/cpp/flann/flann.h:603,
from ....../flann/src/cpp/flann/flann.cpp:31:
....../flann/src/cpp/flann/util/any.h: In member function 'virtual void flann::anyimpl::big_any_policy<T>::static_delete(void**)':
....../flann/src/cpp/flann/util/any.h:81:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
if (* x) delete (* reinterpret_cast<T**>(x)); *x = NULL;
^~
....../flann/src/cpp/flann/util/any.h:81:55: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
if (* x) delete (* reinterpret_cast<T**>(x)); *x = NULL;
^
In file included from ....../flann/src/cpp/flann/util/params.h:33,
from ....../flann/src/cpp/flann/flann.hpp:42,
from ....../flann/src/cpp/flann/flann_cpp.cpp:30:
....../flann/src/cpp/flann/util/any.h: In member function 'virtual void flann::anyimpl::big_any_policy<T>::static_delete(void**)':
....../flann/src/cpp/flann/util/any.h:81:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
if (* x) delete (* reinterpret_cast<T**>(x)); *x = NULL;
^~
....../flann/src/cpp/flann/util/any.h:81:55: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
if (* x) delete (* reinterpret_cast<T**>(x)); *x = NULL;
^
[ 37%] Linking CXX static library ../../lib/libflann_cpp_s.a
cd ....../flann/build/src/cpp && /usr/bin/cmake -P CMakeFiles/flann_cpp_s.dir/cmake_clean_target.cmake
cd ....../flann/build/src/cpp && /usr/bin/cmake -E cmake_link_script CMakeFiles/flann_cpp_s.dir/link.txt --verbose=1
/opt/compilers/RPi/bin/arm-rpi-linux-gnueabihf-ar qc ../../lib/libflann_cpp_s.a CMakeFiles/flann_cpp_s.dir/flann/flann_cpp.cpp.o
/opt/compilers/RPi/bin/arm-rpi-linux-gnueabihf-ranlib ../../lib/libflann_cpp_s.a
make[2]: Leaving directory '....../flann/build'
[ 37%] Built target flann_cpp_s
make -f src/cpp/CMakeFiles/flann_cpp.dir/build.make src/cpp/CMakeFiles/flann_cpp.dir/depend
make[2]: Entering directory '....../flann/build'
cd ....../flann/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" ....../flann ....../flann/src/cpp ....../flann/build ....../flann/build/src/cpp ....../flann/build/src/cpp/CMakeFiles/flann_cpp.dir/DependInfo.cmake --color=
Scanning dependencies of target flann_cpp
make[2]: Leaving directory '....../flann/build'
make -f src/cpp/CMakeFiles/flann_cpp.dir/build.make src/cpp/CMakeFiles/flann_cpp.dir/build
make[2]: Entering directory '....../flann/build'
[ 50%] Building CXX object src/cpp/CMakeFiles/flann_cpp.dir/empty.cpp.o
cd ....../flann/build/src/cpp && /opt/compilers/RPi/bin/arm-rpi-linux-gnueabihf-g++ --sysroot=....../RPi/arm-rpi-linux-gnueabihf/sysroot -DFLANN_EXPORTS -D_FLANN_VERSION=1.9.1 -I....../flann/src/cpp -I/usr/include -O2 -g -DNDEBUG -fPIC -Wall -Wno-unknown-pragmas -Wno-unused-function -o CMakeFiles/flann_cpp.dir/empty.cpp.o -c ....../flann/src/cpp/empty.cpp
[ 62%] Linking CXX shared library ../../lib/libflann_cpp.so
cd ....../flann/build/src/cpp && /usr/bin/cmake -E cmake_link_script CMakeFiles/flann_cpp.dir/link.txt --verbose=1
/opt/compilers/RPi/bin/arm-rpi-linux-gnueabihf-g++ --sysroot=....../RPi/arm-rpi-linux-gnueabihf/sysroot -fPIC -I/usr/include -O2 -g -DNDEBUG -shared -Wl,-soname,libflann_cpp.so.1.9 -o ../../lib/libflann_cpp.so.1.9.1 CMakeFiles/flann_cpp.dir/empty.cpp.o -Wl,-whole-archive ../../lib/libflann_cpp_s.a -Wl,-no-whole-archive
cd ....../flann/build/src/cpp && /usr/bin/cmake -E cmake_symlink_library ../../lib/libflann_cpp.so.1.9.1 ../../lib/libflann_cpp.so.1.9 ../../lib/libflann_cpp.so
make[2]: Leaving directory '....../flann/build'
[ 62%] Built target flann_cpp
In file included from ....../flann/src/cpp/flann/algorithms/all_indices.h:35,
from ....../flann/src/cpp/flann/flann.hpp:45,
from ....../flann/src/cpp/flann/flann.h:603,
from ....../flann/src/cpp/flann/flann.cpp:31:

VERY Important:

  • If you build flann from source on a Raspberry Pi 3B, your system is going to hang HERE, possibly due to lack of memory..
  • Raspberry Pi 3B has 4 cores ONLY, but now you can use MORE cores on your host PC, which is clearly one advantage of using cross compiling.

Finally, you’ll see flann has been successfully cross compiled as:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
....../flann/src/cpp/flann/algorithms/autotuned_index.h: In member function 'void flann::AutotunedIndex<Distance>::optimizeKMeans(std::vector<flann::AutotunedIndex<Distance>::CostData>&) [with Distance = flann::L2<double>]':
....../flann/src/cpp/flann/algorithms/autotuned_index.h:379:31: note: parameter passing for argument of type 'flann::L2<double>' changed in GCC 7.1
KMeansIndex<Distance> kmeans(sampledDataset_, cost.params, distance_);
^~~~~~
[ 75%] Linking CXX static library ../../lib/libflann_s.a
cd ....../flann/build/src/cpp && /usr/bin/cmake -P CMakeFiles/flann_s.dir/cmake_clean_target.cmake
cd ....../flann/build/src/cpp && /usr/bin/cmake -E cmake_link_script CMakeFiles/flann_s.dir/link.txt --verbose=1
/opt/compilers/RPi/bin/arm-rpi-linux-gnueabihf-ar qc ../../lib/libflann_s.a CMakeFiles/flann_s.dir/flann/flann.cpp.o
/opt/compilers/RPi/bin/arm-rpi-linux-gnueabihf-ranlib ../../lib/libflann_s.a
make[2]: Leaving directory '....../flann/build'
[ 75%] Built target flann_s
make -f src/cpp/CMakeFiles/flann.dir/build.make src/cpp/CMakeFiles/flann.dir/depend
make[2]: Entering directory '....../flann/build'
cd ....../flann/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" ....../flann ....../flann/src/cpp ....../flann/build ....../flann/build/src/cpp ....../flann/build/src/cpp/CMakeFiles/flann.dir/DependInfo.cmake --color=
Scanning dependencies of target flann
make[2]: Leaving directory '....../flann/build'
make -f src/cpp/CMakeFiles/flann.dir/build.make src/cpp/CMakeFiles/flann.dir/build
make[2]: Entering directory '....../flann/build'
[ 87%] Building CXX object src/cpp/CMakeFiles/flann.dir/empty.cpp.o
cd ....../flann/build/src/cpp && /opt/compilers/RPi/bin/arm-rpi-linux-gnueabihf-g++ --sysroot=....../RPi/arm-rpi-linux-gnueabihf/sysroot -DFLANN_EXPORTS -D_FLANN_VERSION=1.9.1 -I....../flann/src/cpp -I/usr/include -O2 -g -DNDEBUG -fPIC -Wall -Wno-unknown-pragmas -Wno-unused-function -o CMakeFiles/flann.dir/empty.cpp.o -c ....../flann/src/cpp/empty.cpp
[100%] Linking CXX shared library ../../lib/libflann.so
cd ....../flann/build/src/cpp && /usr/bin/cmake -E cmake_link_script CMakeFiles/flann.dir/link.txt --verbose=1
/opt/compilers/RPi/bin/arm-rpi-linux-gnueabihf-g++ --sysroot=....../RPi/arm-rpi-linux-gnueabihf/sysroot -fPIC -I/usr/include -O2 -g -DNDEBUG -shared -Wl,-soname,libflann.so.1.9 -o ../../lib/libflann.so.1.9.1 CMakeFiles/flann.dir/empty.cpp.o -Wl,-whole-archive ../../lib/libflann_s.a -Wl,-no-whole-archive -Wl,--push-state,--no-as-needed -Wl,--pop-state
cd ....../flann/build/src/cpp && /usr/bin/cmake -E cmake_symlink_library ../../lib/libflann.so.1.9.1 ../../lib/libflann.so.1.9 ../../lib/libflann.so
make[2]: Leaving directory '....../flann/build'
[100%] Built target flann
make[1]: Leaving directory '....../flann/build'
/usr/bin/cmake -E cmake_progress_start ....../flann/build/CMakeFiles 0

You can now:

  • make install to install the built/generated libraries installed under CMAKE_INSTALL_PREFIX
  • copy and paste the built/generated libraries onto Raspberry Pi 3B and use it directly.

BTW: do NOT forget to install the header files.

5. Additional Issues

Multilib/multiarch seems to be problematic nowadays. Please pay attention to Multilib/multiarch. Some related issues are enumuated as the end of this blog.

Alright, that’s all for today. Let me go to bed. Good bye…

😪
😴

Today, we are going to talk about a fabulous project: stereo vision on a zynq-7010 board.

1. VCSBC nano Z-RH-2

1.1 Hardware

We are using a VCSBC nano Z-RH-2 board for today’s experiment. The board adopted looks like the following:

Front Back Connector
VCSBC nano Z-RH-2 Front VCSBC nano Z-RH-2 Back VCSBC nano Z-RH-2 Connector

More detailed specifications, please refer to Vision Components’s official website.

1.2 Software

After you set up a static IP for this Vision Components SBC, it’s pretty straightforward to ssh into the system.

1
2
3
4
5
6
7
8
9
10
11
longervision-GT72-6QE% ssh user@192.168.1.79
user@192.168.1.79's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Aug 29 18:17:49 2019 from 192.168.1.200
user@VC-Z:~$

Currently, VC provides Linux Kernel 3.14.79.

1
2
user@VC-Z:~$ uname -a
Linux VC-Z 3.14.79-vc-z #2 SMP PREEMPT Wed Apr 24 18:33:06 CEST 2019 armv7l GNU/Linux

And, let’s take a look at the dual ARMv7 CPUs on zynq-7010.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
user@VC-Z:~$ cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 0 (v7l)
BogoMIPS : 1725.23
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc09
CPU revision : 0

processor : 1
model name : ARMv7 Processor rev 0 (v7l)
BogoMIPS : 1725.23
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpd32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc09
CPU revision : 0

Hardware : Xilinx Zynq Platform
Revision : 0000
Serial : 0000000000000000

2. Stereo Vision

Sorry everybody. Today, I ONLY test stereo vision on ARM. I’ll try to figure out how to flash an open source IP of stereo vision onto zynq-7010, or write my own ASAP.

Hmmmmmmmm… It’s better I keep my code in dark???

😝

2.1 Classical Image Pairs

Let’s try out the stereo vision on some .pgm image pairs FIRST.

1
2
3
4
5
user@VC-Z:~/longervision$ ./pgmpair ../images/aloe_left.pgm ../images/aloe_right.pgm 
width= 1282
height= 1110
fps: 0.119696
process: 398651

My GOD… It’s UNBELIEVABLY SLOW.

aloe_left aloe_right
aloe_left aloe_right
aloe_left Stereo aloe_right Stereo
aloe_left Stereo aloe_right Stereo

2.2 Live Video Pairs

The BEST demo code to test Vision Componenets Stereo Vision is Eclipse_Example_Projects_VC_Z.

2.2.1 imageCaptureTest

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#./imageCaptureTest 
0


-----------------------------------------------------------------------
VCCapt @0xbe87153c Sensor Count: 2
-----------------------------------------------------------------------

Camera Type : NANO Z RH Rev.0
Sensor 0 Type : E2V_EV76C560ABT_1_0
Sensor 1 Type : E2V_EV76C560ABT_1_0

Trigger Source : IMM

___________________________________________________________________
Sensor[ 0]: Shutter: 12345 us, Gain: 0.00

x0, y0 : ( 0, 0)
binX, binY : ( 1, 1)
subsmplX, subsmplY, flip: ( 1, 1,0x00)
(img) dx, dy, pitch: ( 1280, 1024), 1280

(img) st, ccmp1, ccmp2, type: 0xb6b03080, 0x00000000, 0x00000000, 0

Description
Sen dx, Sen dy, Sen pitch: 1280, 1024, 1280
Max dx, Max dy, Max pitch: 1280, 1024, 1280
Binning Max (dx, dy), Square: 2, 1, 1
Subsmpl Max (dx, dy), Square: 8, 8, 0
Init st,ccmp1,ccmp2: 0xb6b03080, 0x00000000, 0x00000000
Init Shutter, Gain, Type: 10000, 0.00, GREY (0)
FD, Port, Type: 4, 0, E2V_EV76C560ABT_1_0

Volatile Description
requestCaptID, State: 0, IDLE
captId, TimestampTicks: 0, 6476832867277

Externals Description
pos[0-3], angle[0-2]: [ 0.00, 0.00, 0.00],[ 0.0, 0.0]

___________________________________________________________________
Sensor[ 1]: Shutter: 10000 us, Gain: 0.00

x0, y0 : ( 0, 0)
binX, binY : ( 1, 1)
subsmplX, subsmplY, flip: ( 1, 1,0x00)
(img) dx, dy, pitch: ( 1280, 1024), 1280

(img) st, ccmp1, ccmp2, type: 0xb69c2080, 0x00000000, 0x00000000, 0

Description
Sen dx, Sen dy, Sen pitch: 1280, 1024, 1280
Max dx, Max dy, Max pitch: 1280, 1024, 1280
Binning Max (dx, dy), Square: 2, 1, 1
Subsmpl Max (dx, dy), Square: 8, 8, 0
Init st,ccmp1,ccmp2: 0xb69c2080, 0x00000000, 0x00000000
Init Shutter, Gain, Type: 10000, 0.00, GREY (0)
FD, Port, Type: 5, 1, E2V_EV76C560ABT_1_0

Volatile Description
requestCaptID, State: 0, IDLE
captId, TimestampTicks: 0, 6476832867284

Externals Description
pos[0-3], angle[0-2]: [ 0.00, 0.00, 0.00],[ 0.0, 0.0]

-----------------------------------------------------------------------
......

2.2.2 imageCaptFPS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
03:41:47[root@VC-Z] /home/user/vc/Eclipse_Example_Projects_VC_Z/imageCaptFPS
#./imageCaptFPS
dy= 1024 Clock=100000000 Acquisiton&Copy Duration: 28s 780685us for 1000 Cycles == 34.745525fps.
dy= 768 Clock=100000000 Acquisiton&Copy Duration: 28s 789899us for 1000 Cycles == 34.734402fps.
dy= 640 Clock=100000000 Acquisiton&Copy Duration: 28s 790000us for 1000 Cycles == 34.734283fps.
dy= 512 Clock=100000000 Acquisiton&Copy Duration: 28s 790012us for 1000 Cycles == 34.734268fps.
dy= 384 Clock=100000000 Acquisiton&Copy Duration: 28s 790005us for 1000 Cycles == 34.734280fps.
dy= 256 Clock=100000000 Acquisiton&Copy Duration: 28s 790000us for 1000 Cycles == 34.734283fps.
dy= 192 Clock=100000000 Acquisiton&Copy Duration: 28s 790021us for 1000 Cycles == 34.734257fps.
dy= 128 Clock=100000000 Acquisiton&Copy Duration: 28s 789984us for 1000 Cycles == 34.734303fps.
dy= 64 Clock=100000000 Acquisiton&Copy Duration: 28s 789987us for 1000 Cycles == 34.734299fps.
dy= 32 Clock=100000000 Acquisiton&Copy Duration: 28s 789997us for 1000 Cycles == 34.734287fps.
dy= 16 Clock=100000000 Acquisiton&Copy Duration: 28s 790017us for 1000 Cycles == 34.734264fps.
dy= 8 Clock=100000000 Acquisiton&Copy Duration: 28s 790002us for 1000 Cycles == 34.734280fps.
dy= 4 Clock=100000000 Acquisiton&Copy Duration: 28s 789985us for 1000 Cycles == 34.734303fps.
dy= 2 Clock=100000000 Acquisiton&Copy Duration: 28s 789997us for 1000 Cycles == 34.734287fps.
dy= 1 Clock=100000000 Acquisiton&Copy Duration: 28s 789994us for 1000 Cycles == 34.734291fps.

The above 2 examples are directly run on Vision Components’s board without display, for the given cable is of VGA connector, which is ALREADY outdated for many years. Therefore, in order to show the captured image pairs, in the next section, we’ll have to stream the captured data to a host computer, and display the real-time video pairs.

2.3 Stream/Display From Host Computer

Due to Vision Componenets’ Official documentation VCLinux_Getting_Started.pdf, images captured from camera can be displayed on a remote hosting PC.

2.3.1 Eclipse_Example_Projects_VC_Z (Not Preferred)

Eclipse_Example_Projects_VC_Z.zip provides some source code, which displays images captured from camera on the hosting PC’s Eclipse, by adding the camera as a Remote System to Eclipse. Anyway, by using this method, you need to prepare ALL the following software and packages in advance.

2.3.2 vcimgnetclient.py

Besides the above method, a much more straightforward method is to adopt python script vcimgnetclient.py provided by Vision Components. However, vcimgnetclient.py is ONLY python2 compatible, and Vision Components has NO plan to provide a python3 compatible version of vcimgnetclient.py.

Therefore, the KEY to use the 2nd method is to make vcimgnetclient.py python3 compatible.

2.3.2.1 2to3

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
longervision-GT72-6QE% 2to3 vcimgnetclient.py
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: Refactored vcimgnetclient.py
--- vcimgnetclient.py (original)
+++ vcimgnetclient.py (refactored)
@@ -274,11 +274,11 @@
if(chk_rgb_true):
dy /= 3
#img_data_packed = bytearray(chain.from_iterable(izip(mv_img_data[2 * pitch * dy:], mv_img_data[1 * pitch * dy:], mv_img_data[0 * pitch * dy:])))
- img_data_packed = bytearray(chain.from_iterable(zip(mv_img_data[2 * pitch * dy:], mv_img_data[1 * pitch * dy:], mv_img_data[0 * pitch * dy:])))
+ img_data_packed = bytearray(chain.from_iterable(list(zip(mv_img_data[2 * pitch * dy:], mv_img_data[1 * pitch * dy:], mv_img_data[0 * pitch * dy:]))))
else:
dy /= 1
#img_data_packed = bytearray(chain.from_iterable(izip(mv_img_data[0 * pitch * dy:], mv_img_data[0 * pitch * dy:], mv_img_data[0 * pitch * dy:])))
- img_data_packed = bytearray(chain.from_iterable(zip(mv_img_data[0 * pitch * dy:], mv_img_data[0 * pitch * dy:], mv_img_data[0 * pitch * dy:])))
+ img_data_packed = bytearray(chain.from_iterable(list(zip(mv_img_data[0 * pitch * dy:], mv_img_data[0 * pitch * dy:], mv_img_data[0 * pitch * dy:]))))
cpb = Gdk.pixbuf_new_from_data(buffer(img_data_packed), Gdk.COLORSPACE_RGB, False, 8, dx, dy, 3*pitch)
cpb.save(path, "png")

@@ -589,16 +589,16 @@
dy /= 3
mv_img_data = memoryview(img['data'])
#img_data_packed = bytearray(chain.from_iterable(izip(mv_img_data[2 * pitch * dy:], mv_img_data[1 * pitch * dy:], mv_img_data[0 * pitch * dy:])))
- img_data_packed = bytearray(chain.from_iterable(zip(mv_img_data[2 * pitch * dy:], mv_img_data[1 * pitch * dy:], mv_img_data[0 * pitch * dy:])))
+ img_data_packed = bytearray(chain.from_iterable(list(zip(mv_img_data[2 * pitch * dy:], mv_img_data[1 * pitch * dy:], mv_img_data[0 * pitch * dy:]))))
self.area.window.draw_rgb_image(gc, 0,0, dx,dy, Gdk.RGB_DITHER_NONE, buffer(img_data_packed),3*pitch,0,0)
else:
if('flscol'==self.how_select):
mv_img_data = memoryview(img['data']).tolist()
- r_data = map(falsecolor_r,mv_img_data[0 * pitch * dy:])
- g_data = map(falsecolor_g,mv_img_data[0 * pitch * dy:])
- b_data = map(falsecolor_b,mv_img_data[0 * pitch * dy:])
+ r_data = list(map(falsecolor_r,mv_img_data[0 * pitch * dy:]))
+ g_data = list(map(falsecolor_g,mv_img_data[0 * pitch * dy:]))
+ b_data = list(map(falsecolor_b,mv_img_data[0 * pitch * dy:]))
#img_data_packed = bytearray(chain.from_iterable(izip(r_data, g_data, b_data)))
- img_data_packed = bytearray(chain.from_iterable(zip(r_data, g_data, b_data)))
+ img_data_packed = bytearray(chain.from_iterable(list(zip(r_data, g_data, b_data))))
self.area.window.draw_rgb_image(gc, 0,0, dx,dy, Gdk.RGB_DITHER_NONE, buffer(img_data_packed),3*pitch,0,0)
else: #grey
self.area.window.draw_gray_image(gc, 0,0,
RefactoringTool: Files that need to be modified:
RefactoringTool: vcimgnetclient.py

2.3.2.2 pygi-convert

Please refer to General Porting Tips

1
2
longervision-GT72-6QE% ./pygi-convert.sh vcimgnetclient.py
longervision-GT72-6QE%

2.3.2.3 Try Running

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
longervision-GT72-6QE% python vcimgnetclient.py 
vcimgnetclient.py:330: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "type" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
self.window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
vcimgnetclient.py:628: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
mfQuit = Gtk.MenuItem("Quit")
vcimgnetclient.py:629: PyGIDeprecationWarning: Using non GObject arguments for connect_object() is deprecated, use: connect_data(signal, callback, data, connect_flags=GObject.ConnectFlags.SWAPPED)
mfQuit.connect_object("activate", lambda a: Gtk.main_quit(), "mfQuit")
vcimgnetclient.py:637: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
bmf = Gtk.MenuItem("File")
vcimgnetclient.py:646: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
mhAbout = Gtk.MenuItem("About")
vcimgnetclient.py:654: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
bmh = Gtk.MenuItem("Help")
Traceback (most recent call last):
File "vcimgnetclient.py", line 812, in <module>
Main()
File "vcimgnetclient.py", line 719, in __init__
Frontend.__init__(self, self.img_access)
File "vcimgnetclient.py", line 301, in __init__
self.winMain = self.WinMain(arg_img_access, self.dialog)
File "vcimgnetclient.py", line 341, in __init__
vbox.pack_start(self.menu_bar, False, False)
TypeError: Gtk.Box.pack_start() takes exactly 5 arguments (4 given)

2.3.2.4

For ALL vbox.pack_start, add one parameter 0 at the end for each case. For instance: vbox.pack_start(self.menu_bar, False, False) to vbox.pack_start(self.menu_bar, False, False, 0)

Oh my god … There are STILL SO MANY things to do, in order to make vcimgnetclient.py Python3 compatible. Therefore, I implement my own vcimgnetclient_qt.py based on PyQt5.

2.3.3 Longer Vision’s vcimgnetclient_qt.py

2.3.3.1 Server

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
22:42:22[root@VC-Z] /home/user
#whoami
root

22:42:24[root@VC-Z] /home/user
#vcimgnetsrv &
[1] 896

22:42:30[root@VC-Z] /home/user
#ps -e | grep vcimgnetsrv
896 pts/0 00:00:00 vcimgnetsrv

22:42:40[root@VC-Z] /home/user
#vctp
Acquisiton&Copy Duration: 4s 39644us for 100 Cycles == 24.754656fps.

Acquisiton&Copy Duration: 4s 34709us for 100 Cycles == 24.784935fps.
......

2.3.3.2 Client

Sorry, I’m NOT going to show my code, but the performance can be demonstrated as follows:

LVT VC PyQt5 GUI

Today’s weather is perfect for this party: annual summer alumni party of Wuhan University.

Alumni Me
Alumni Me

Today, I’ve got another GOOD news: our ARM Linux board based on AllWinner H3 is demonstrated successful.

1. Hardware

1.1 Appearance

Yeah, this is how OUR OWN board looks like:

LongerVisionTech H3 Board

1.2 Specifications

From the appearance, it’s NOT hard to tell the specifications:

Device Version Units
USB 2.0 2
Wired 100Mbps 1
HDMI 1.4 1
Power Adaptor 5V 1

2. Flash Armbian Debian

2.1 Armbian for AllWinner H3

Armbian provides abundant info for AllWinner H3:

2.2 Armbian for Orange Pi PC

I’m so lucky today that I tried ONLY ONE TIME and have this Debian Buster with Armbian Linux for Orange Pi PC successfully installed and run on our board. You just need to download and extract Armbian_5.91_Orangepipc_Debian_buster_next_4.19.59.img out, and have it installed by dd.

2.3 Longer Vision Technology H3 Board Test

It’s NOT hard to find out your board’s IP address

  • either from within your router
  • or boot your board with a monitor and run the command ip -c address.

Now, you should be able to SSH into your H3 baord directly as follows:

Armbian for LVT H3 Board

After you run

  • sudo apt update and sudo apt upgrade
  • sudo armbian-config

you should be able to upgrade your Debian Buster with Armbian Linux from 4.19.59-sunxi to 4.19.62-sunxi.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
longervision-GT72-6QE% ssh longervision@192.168.1.96
longervision@192.168.1.96's password:
___ ____ _ ____ ____
/ _ \| _ \(_) | _ \ / ___|
| | | | |_) | | | |_) | |
| |_| | __/| | | __/| |___
\___/|_| |_| |_| \____|

Welcome to Debian Buster with Armbian Linux 4.19.62-sunxi
System load: 0.16 0.12 0.08 Up time: 6 min
Memory usage: 18 % of 460MB IP: 192.168.1.96
CPU temp: 79°C
Usage of /: 2% of 58G

Last login: Sun Aug 25 20:13:29 2019 from 192.168.1.200

3. Issues

It’s a kind of late. Let me finish this up for now ASAP.

3.1 Hardware Issues

  • ONLY 1 USB 2.0 port is working properly.
  • It’s EASY to reach the critical temperature, as showing:
Critial Temperature Reached

3.2 Features Expected

We really need a better low-cost chip to provide the support for:

  • USB 3.0
  • GigE
0%