RoadTest: Intel Neural Compute Stick 2
Author: redcharly
Creation date:
Evaluation Type: Development Boards & Tools
Did you receive all parts the manufacturer stated would be included in the package?: True
What other parts do you consider comparable to this product?:
What were the biggest problems encountered?:
Detailed Review:
In this roadtest I will try to use Intel's Neural Compute Stick 2 using it with a Raspberry pi4. My aim is to make something that can be used simply and everywhere. We chose to use Raspberry its small size and its computing power. Its reduced energy consumption also makes it an optimal solution to create an autonomous system that can be used in multiple IoT applications, like facial recognition or car license plates, etc.
Our aim is to create a simple and inexpensive test system that we could use at school to introduce artificial intelligence concepts.
Particular attention was paid to the power supply of the Raspberry which, having to power the Neural Compute Stick 2 through one of its USB ports and a webcam, needed a power supply with sufficient current. For our tests we used a 5V, 2.5A power supply and we did not encounter any problems whatsoever. Obviously, for continuous use of the device, it would be advisable to have a more powerful power supply to have greater system reliability.
Since I learned that I was chosen for the roadtest, I have been looking forward to having it in my hands. Opening the box was very exciting, like unpacking a Christmas present!
{gallery} Unboxing |
---|
The Intel Neural Compute Stick 2 is a very beautiful object, has a very elegant and functional line, and is entirely made of aluminum, a feature that greatly facilitates heat dissipation compared to other similar devices.
In 2017 a startup called Movidius launched what was the world’s first deep learning processor on a USB stick. Based around their Myriad 2 Vision Processor (VPU), the Fathom Neural Compute Stick was the first of its kind. Then the company was bought by Intel and, two years later, Intel unveiled the second generation stick making use of the Myriad X VPU but there wasn’t any support for using it with non-x86_64 architectures. Now, the Neural Compute Stick 2 is also usable by Raspberry pi 4.
{gallery} Neural Compute Stick |
---|
In order to use the Intel Compute Stick 2 on a Raspberry pi4, it is necessary to perform the procedure which is carefully described by Openvino in the link:
The procedure is quite simple and it only takes a few minutes to get to the configuration of the NCS2.
The OpenVINO Toolkit contains 3 important components that are installed by default: the Inference Engine, the OpenCV and Sample Applications.
The following software is required for installation:
There is no installer so the installation must be done step by step entirely from the command line. The first thing to do is download the compressed file of the toolkit from the link: https://storage.openvinotoolkit.org/repositories/openvino/packages/
The file must then be unpacked into a folder and other software components must then be installed. As already said you need to install CMake and Python, if they are not already present in the system, set the environment variables, and run the script at the end: install_NCS_udev_rules.sh.
Plug in the Neural Compute Stick and if you check dmesg you should see something like this.
We can then start using our Intel Neural Compute Stick 2 using some of the examples contained in the OpenVINO installation.
For our tests we will use a system made with:
In this roadtest we will show only two of the numerous ready-made examples with which it is possible to test the possibilities given by the Intel NCS2.
We will start with a very light example such as the recognition of faces on an image and we will then move on to searching for faces on a video in real-time, obviously much heavier work for our system. We also tried other examples such as those relating to the recognition and classification of cars, bicycles, and pedestrians, the recognition of car license plates, etc. All the tested examples have confirmed the effectiveness of this Intel-Raspberry pairing.
As the first example of application, we use a simple application that recognizes a human face within a photograph.
Upon the start-up, the sample application reads command line parameters and loads a network and an image to the Inference Engine plugin. When inference is done, the application creates an output image and outputs data to the standard output stream.
Let's open a shell and write the appropriate commands:
cd inference_engine_vpu_arm/deployment_tools/inference_engine/samples
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=arm7-a"
make -j2 object_detection_sample_ssd
Unlike the official Intel distribution, the Raspberry Pi version of the toolkit lacks both the model and the XML file associated with it containing the model topology. So before we can run the model we also need to download both of those files.
wget --no-check-certificate https://download.01.org/openvinotoolkit/2018_R5/open_model_zoo/face-detection-adas-0001/FP16/face-detection-adas-0001.bin
wget --no-check-certificate https://download.01.org/openvinotoolkit/2018_R5/open_model_zoo/face-detection-adas-0001/FP16/face-detection-adas-0001.xml
Information relating to this example is contained at https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/intel/face-detection-adas-0001/description/face-detection-adas-0001.md. Regarding the definition of the input and output, we can use the following information:
Inputs
Name: input
, shape: [1x3x384x672] - An input image in the format [BxCxHxW], where: - B - batch size - C - number of channels - H - image height - W - image width
The expected color order is BGR.
Outputs
The net outputs blob with shape: [1, 1, N, 7], where N is the number of detected bounding boxes. The results are sorted by confidence in decreasing order. Each detection has the format [image_id
, label
, conf
, x_min
, y_min
, x_max
, y_max
], where:
image_id
- ID of the image in the batchlabel
- predicted class ID (1 - face)conf
- confidence for the predicted classx_min
,y_min
) - coordinates of the top left bounding box cornerx_max
,y_max
) - coordinates of the bottom right bounding box corner.
After we have loaded the model and its topology, we can finally see the system in action. It will only be necessary to choose a photo containing human faces to be able to test the ability of the neural network to correctly recognize faces. We will do a couple of experiments.
First, we use a photo with only one face. Do you remember Frank Sinatra?
[ INFO ] InferenceEngine: API version ............ 1.6 Build .................. 22443 Parsing input parameters [ INFO ] Files were added: 1 [ INFO ] /home/pi/sinatra.jpg [ INFO ] Loading plugin API version ............ 1.6 Build .................. 22443 Description ....... myriadPlugin [ 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 plugin [ WARNING ] Image is resized from (602, 720) to (672, 384) [ INFO ] Batch size is 1 [ INFO ] Start inference (1 iterations) [ INFO ] Processing output blobs [0,1] element, prob = 0.999023 (337,114)-(444,260) batch id : 0 WILL BE PRINTED! [1,1] element, prob = 0.0209961 (517,484)-(680,791) batch id : 0 [2,1] element, prob = 0.0209961 (560,437)-(644,857) batch id : 0 [3,1] element, prob = 0.0200195 (282,94)-(513,649) batch id : 0 [4,1] element, prob = 0.019043 (149,137)-(179,202) batch id : 0 [5,1] element, prob = 0.0180664 (185,240)-(234,341) batch id : 0 [6,1] element, prob = 0.0170898 (141,140)-(165,190) batch id : 0 [7,1] element, prob = 0.0170898 (145,111)-(182,164) batch id : 0 [8,1] element, prob = 0.0170898 (0,15)-(168,383) batch id : 0 [9,1] element, prob = 0.0170898 (9,51)-(288,611) batch id : 0 [10,1] element, prob = 0.0161133 (153,119)-(173,155) batch id : 0 [11,1] element, prob = 0.0161133 (155,147)-(174,189) batch id : 0 [12,1] element, prob = 0.0161133 (141,167)-(169,229) batch id : 0 [13,1] element, prob = 0.0161133 (159,170)-(188,232) batch id : 0 [14,1] element, prob = 0.0161133 (159,249)-(222,399) batch id : 0 [15,1] element, prob = 0.0161133 (547,595)-(615,749) batch id : 0 [16,1] element, prob = 0.0161133 (349,-46)-(501,234) batch id : 0 [17,1] element, prob = 0.015625 (139,116)-(163,158) batch id : 0 [18,1] element, prob = 0.015625 (166,140)-(188,187) batch id : 0 [19,1] element, prob = 0.015625 (166,178)-(186,217) batch id : 0 [20,1] element, prob = 0.015625 (583,680)-(601,719) batch id : 0 [21,1] element, prob = 0.015625 (155,181)-(192,266) batch id : 0 [22,1] element, prob = 0.015625 (413,221)-(452,291) batch id : 0 [23,1] element, prob = 0.015625 (118,26)-(288,357) batch id : 0 [24,1] element, prob = 0.015625 (503,453)-(590,828) batch id : 0 [25,1] element, prob = 0.0146484 (168,121)-(188,157) batch id : 0 [26,1] element, prob = 0.0146484 (127,139)-(150,187) batch id : 0 [27,1] element, prob = 0.0146484 (141,179)-(160,218) batch id : 0 [28,1] element, prob = 0.0146484 (167,206)-(186,241) batch id : 0 [29,1] element, prob = 0.0146484 (155,126)-(196,213) batch id : 0 [30,1] element, prob = 0.0146484 (429,130)-(467,202) batch id : 0 [31,1] element, prob = 0.0146484 (557,420)-(599,538) batch id : 0 [32,1] element, prob = 0.0146484 (557,465)-(601,578) batch id : 0 [33,1] element, prob = 0.0146484 (134,552)-(162,617) batch id : 0 [34,1] element, prob = 0.0146484 (547,-15)-(644,372) batch id : 0 [35,1] element, prob = 0.0136719 (140,88)-(160,121) batch id : 0 [36,1] element, prob = 0.0136719 (154,175)-(174,218) batch id : 0 [37,1] element, prob = 0.0136719 (580,380)-(601,427) batch id : 0 [38,1] element, prob = 0.0136719 (134,80)-(165,131) batch id : 0 [39,1] element, prob = 0.0136719 (148,79)-(180,130) batch id : 0 [40,1] element, prob = 0.0136719 (123,111)-(157,162) batch id : 0 [41,1] element, prob = 0.0136719 (423,105)-(473,161) batch id : 0 [42,1] element, prob = 0.0136719 (137,194)-(165,250) batch id : 0 [43,1] element, prob = 0.0136719 (173,191)-(204,258) batch id : 0 [44,1] element, prob = 0.0136719 (421,164)-(478,263) batch id : 0 [45,1] element, prob = 0.0136719 (162,211)-(190,276) batch id : 0 [46,1] element, prob = 0.0136719 (176,274)-(211,362) batch id : 0 [47,1] element, prob = 0.0136719 (575,403)-(607,470) batch id : 0 [48,1] element, prob = 0.0136719 (580,423)-(604,497) batch id : 0 [49,1] element, prob = 0.0136719 (576,521)-(607,586) batch id : 0 [50,1] element, prob = 0.0136719 (557,556)-(602,651) batch id : 0 [51,1] element, prob = 0.0136719 (436,94)-(502,216) batch id : 0 [52,1] element, prob = 0.0136719 (157,145)-(210,281) batch id : 0 [53,1] element, prob = 0.0136719 (472,146)-(532,258) batch id : 0 [54,1] element, prob = 0.0136719 (462,216)-(536,317) batch id : 0 [55,1] element, prob = 0.0126953 (155,87)-(174,121) batch id : 0 [56,1] element, prob = 0.0126953 (181,146)-(200,189) batch id : 0 [57,1] element, prob = 0.0126953 (183,175)-(200,213) batch id : 0 [58,1] element, prob = 0.0126953 (155,195)-(177,243) batch id : 0 [59,1] element, prob = 0.0126953 (182,265)-(203,308) batch id : 0 [60,1] element, prob = 0.0126953 (199,294)-(217,331) batch id : 0 [61,1] element, prob = 0.0126953 (196,320)-(219,365) batch id : 0 [62,1] element, prob = 0.0126953 (211,326)-(232,367) batch id : 0 [63,1] element, prob = 0.0126953 (116,536)-(135,581) batch id : 0 [64,1] element, prob = 0.0126953 (130,104)-(177,185) batch id : 0 [65,1] element, prob = 0.0126953 (162,116)-(194,171) batch id : 0 [66,1] element, prob = 0.0126953 (120,126)-(163,213) batch id : 0 [67,1] element, prob = 0.0126953 (171,136)-(205,193) batch id : 0 [68,1] element, prob = 0.0126953 (444,142)-(485,206) batch id : 0 [69,1] element, prob = 0.0126953 (174,163)-(203,227) batch id : 0 [70,1] element, prob = 0.0126953 (177,221)-(208,290) batch id : 0 [71,1] element, prob = 0.0126953 (171,213)-(221,317) batch id : 0 [72,1] element, prob = 0.0126953 (159,235)-(204,343) batch id : 0 [73,1] element, prob = 0.0126953 (405,246)-(443,317) batch id : 0 [74,1] element, prob = 0.0126953 (206,305)-(236,376) batch id : 0 [75,1] element, prob = 0.0126953 (574,336)-(603,414) batch id : 0 [76,1] element, prob = 0.0126953 (550,406)-(583,503) batch id : 0 [77,1] element, prob = 0.0126953 (122,554)-(148,617) batch id : 0 [78,1] element, prob = 0.0126953 (-1,552)-(33,664) batch id : 0 [79,1] element, prob = 0.0126953 (407,43)-(475,154) batch id : 0 [80,1] element, prob = 0.0126953 (62,161)-(134,262) batch id : 0 [81,1] element, prob = 0.0126953 (132,150)-(188,267) batch id : 0 [82,1] element, prob = 0.0126953 (180,157)-(246,276) batch id : 0 [83,1] element, prob = 0.0126953 (129,196)-(190,326) batch id : 0 [84,1] element, prob = 0.0126953 (151,323)-(225,433) batch id : 0 [85,1] element, prob = 0.0126953 (560,303)-(603,465) batch id : 0 [86,1] element, prob = 0.0126953 (149,399)-(227,498) batch id : 0 [87,1] element, prob = 0.0126953 (434,494)-(541,788) batch id : 0 [88,1] element, prob = 0.0126953 (465,555)-(616,739) batch id : 0 [89,1] element, prob = 0.0117188 (170,86)-(191,122) batch id : 0 [90,1] element, prob = 0.0117188 (114,118)-(133,155) batch id : 0 [91,1] element, prob = 0.0117188 (485,116)-(503,158) batch id : 0 [92,1] element, prob = 0.0117188 (111,142)-(131,187) batch id : 0 [93,1] element, prob = 0.0117188 (455,149)-(477,186) batch id : 0 [94,1] element, prob = 0.0117188 (128,172)-(150,220) batch id : 0 [95,1] element, prob = 0.0117188 (183,205)-(200,243) batch id : 0 [96,1] element, prob = 0.0117188 (181,230)-(201,276) batch id : 0 [97,1] element, prob = 0.0117188 (199,238)-(218,277) batch id : 0 [98,1] element, prob = 0.0117188 (197,259)-(223,316) batch id : 0 [99,1] element, prob = 0.0117188 (213,265)-(229,306) batch id : 0 [100,1] element, prob = 0.0117188 (184,297)-(201,334) batch id : 0 [101,1] element, prob = 0.0117188 (184,354)-(202,391) batch id : 0 [102,1] element, prob = 0.0117188 (199,355)-(217,391) batch id : 0 [103,1] element, prob = 0.0117188 (184,387)-(205,430) batch id : 0 [104,1] element, prob = 0.0117188 (212,388)-(235,428) batch id : 0 [105,1] element, prob = 0.0117188 (542,387)-(561,420) batch id : 0 [106,1] element, prob = 0.0117188 (557,408)-(580,465) batch id : 0 [107,1] element, prob = 0.0117188 (143,466)-(163,507) batch id : 0 [108,1] element, prob = 0.0117188 (124,526)-(142,569) batch id : 0 [109,1] element, prob = 0.0117188 (569,526)-(593,580) batch id : 0 [110,1] element, prob = 0.0117188 (121,73)-(152,130) batch id : 0 [111,1] element, prob = 0.0117188 (126,66)-(176,148) batch id : 0 [112,1] element, prob = 0.0117188 (109,108)-(141,161) batch id : 0 [113,1] element, prob = 0.0117188 (446,112)-(485,165) batch id : 0 [114,1] element, prob = 0.0117188 (102,127)-(146,214) batch id : 0 [115,1] element, prob = 0.0117188 (502,163)-(538,240) batch id : 0 [116,1] element, prob = 0.0117188 (125,201)-(150,264) batch id : 0 [117,1] element, prob = 0.0117188 (192,196)-(225,261) batch id : 0 [118,1] element, prob = 0.0117188 (134,218)-(160,280) batch id : 0 [119,1] element, prob = 0.0117188 (152,205)-(180,278) batch id : 0 [120,1] element, prob = 0.0117188 (201,235)-(240,307) batch id : 0 [121,1] element, prob = 0.0117188 (426,200)-(475,297) batch id : 0 [122,1] element, prob = 0.0117188 (213,245)-(255,328) batch id : 0 [123,1] element, prob = 0.0117188 (579,492)-(610,556) batch id : 0 [124,1] element, prob = 0.0117188 (114,506)-(155,595) batch id : 0 [125,1] element, prob = 0.0117188 (112,541)-(157,634) batch id : 0 [126,1] element, prob = 0.0117188 (568,651)-(607,729) batch id : 0 [127,1] element, prob = 0.0117188 (53,107)-(143,192) batch id : 0 [128,1] element, prob = 0.0117188 (87,109)-(173,193) batch id : 0 [129,1] element, prob = 0.0117188 (459,108)-(541,199) batch id : 0 [130,1] element, prob = 0.0117188 (5,141)-(66,282) batch id : 0 [131,1] element, prob = 0.0117188 (103,145)-(155,280) batch id : 0 [132,1] element, prob = 0.0117188 (167,207)-(259,363) batch id : 0 [133,1] element, prob = 0.0117188 (119,227)-(205,416) batch id : 0 [ INFO ] Image out_0.bmp created! total inference time: 85.9958 Average running time of one iteration: 85.9958 ms Throughput: 11.6285 FPS [ INFO ] Execution successful
Our second test is instead made on a photo (family.jpg) with five different faces (men, woman, boy, girl, and dog). It's interesting to observe the recognition rate associated with the dog's face.
[ INFO ] InferenceEngine: API version ............ 1.6 Build .................. 22443 Parsing input parameters [ INFO ] Files were added: 1 [ INFO ] /home/pi/famiglia.jpg [ INFO ] Loading plugin API version ............ 1.6 Build .................. 22443 Description ....... myriadPlugin [ 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 plugin [ WARNING ] Image is resized from (684, 250) to (672, 384) [ INFO ] Batch size is 1 [ INFO ] Start inference (1 iterations) [ INFO ] Processing output blobs [0,1] element, prob = 0.999512 (142,36)-(212,112) batch id : 0 WILL BE PRINTED! [1,1] element, prob = 0.999512 (274,80)-(331,154) batch id : 0 WILL BE PRINTED! [2,1] element, prob = 0.993164 (355,73)-(413,151) batch id : 0 WILL BE PRINTED! [3,1] element, prob = 0.976074 (408,23)-(487,110) batch id : 0 WILL BE PRINTED! [4,1] element, prob = 0.248047 (76,133)-(140,216) batch id : 0 [5,1] element, prob = 0.101562 (67,132)-(114,198) batch id : 0 [6,1] element, prob = 0.0546875 (96,131)-(148,188) batch id : 0 [7,1] element, prob = 0.0527344 (57,152)-(117,234) batch id : 0 [8,1] element, prob = 0.0410156 (123,161)-(150,198) batch id : 0 [9,1] element, prob = 0.0405273 (110,183)-(137,215) batch id : 0 [10,1] element, prob = 0.0405273 (221,88)-(277,138) batch id : 0 [11,1] element, prob = 0.0395508 (119,145)-(150,186) batch id : 0 [12,1] element, prob = 0.0395508 (122,181)-(148,211) batch id : 0 [13,1] element, prob = 0.0385742 (124,214)-(149,233) batch id : 0 [14,1] element, prob = 0.0385742 (77,151)-(105,198) batch id : 0 [15,1] element, prob = 0.0385742 (30,147)-(82,205) batch id : 0 [16,1] element, prob = 0.0375977 (114,201)-(134,219) batch id : 0 [17,1] element, prob = 0.0375977 (60,141)-(88,189) batch id : 0 [18,1] element, prob = 0.0375977 (89,154)-(120,199) batch id : 0 [19,1] element, prob = 0.0375977 (67,177)-(154,217) batch id : 0 [20,1] element, prob = 0.0375977 (81,171)-(139,241) batch id : 0 [21,1] element, prob = 0.0366211 (114,195)-(132,210) batch id : 0 [22,1] element, prob = 0.0366211 (127,127)-(172,172) batch id : 0 [23,1] element, prob = 0.0366211 (100,185)-(145,227) batch id : 0 [24,1] element, prob = 0.0356445 (127,194)-(145,209) batch id : 0 [25,1] element, prob = 0.0356445 (126,202)-(147,221) batch id : 0 [26,1] element, prob = 0.0356445 (107,162)-(135,203) batch id : 0 [27,1] element, prob = 0.0356445 (134,159)-(175,202) batch id : 0 [28,1] element, prob = 0.034668 (135,145)-(166,178) batch id : 0 [29,1] element, prob = 0.0341797 (158,173)-(178,192) batch id : 0 [30,1] element, prob = 0.0341797 (129,186)-(147,201) batch id : 0 [31,1] element, prob = 0.0341797 (109,171)-(152,215) batch id : 0 [32,1] element, prob = 0.0341797 (90,195)-(119,229) batch id : 0 [33,1] element, prob = 0.0332031 (145,153)-(163,169) batch id : 0 [34,1] element, prob = 0.0332031 (111,186)-(130,199) batch id : 0 [35,1] element, prob = 0.0332031 (72,126)-(108,169) batch id : 0 [36,1] element, prob = 0.0332031 (106,145)-(159,207) batch id : 0 [37,1] element, prob = 0.0322266 (125,157)-(148,181) batch id : 0 [38,1] element, prob = 0.0322266 (143,159)-(165,183) batch id : 0 [39,1] element, prob = 0.0322266 (97,206)-(115,220) batch id : 0 [40,1] element, prob = 0.0322266 (266,73)-(314,120) batch id : 0 [41,1] element, prob = 0.0322266 (55,124)-(87,159) batch id : 0 [42,1] element, prob = 0.0322266 (95,182)-(125,217) batch id : 0 [43,1] element, prob = 0.0322266 (107,198)-(142,222) batch id : 0 [44,1] element, prob = 0.0322266 (476,23)-(528,82) batch id : 0 [45,1] element, prob = 0.03125 (111,157)-(134,182) batch id : 0 [46,1] element, prob = 0.03125 (127,171)-(147,191) batch id : 0 [47,1] element, prob = 0.03125 (147,174)-(166,189) batch id : 0 [48,1] element, prob = 0.03125 (407,18)-(464,74) batch id : 0 [49,1] element, prob = 0.0302734 (162,181)-(182,201) batch id : 0 [50,1] element, prob = 0.0302734 (83,131)-(122,182) batch id : 0 [51,1] element, prob = 0.0302734 (156,155)-(182,187) batch id : 0 [52,1] element, prob = 0.0302734 (145,167)-(171,195) batch id : 0 [53,1] element, prob = 0.0302734 (129,183)-(172,221) batch id : 0 [54,1] element, prob = 0.0302734 (90,153)-(175,234) batch id : 0 [55,1] element, prob = 0.0292969 (129,153)-(147,169) batch id : 0 [56,1] element, prob = 0.0292969 (81,173)-(99,189) batch id : 0 [57,1] element, prob = 0.0292969 (146,195)-(164,209) batch id : 0 [58,1] element, prob = 0.0292969 (120,126)-(161,157) batch id : 0 [59,1] element, prob = 0.0292969 (156,142)-(186,176) batch id : 0 [60,1] element, prob = 0.0292969 (151,163)-(189,201) batch id : 0 [61,1] element, prob = 0.0292969 (163,164)-(207,203) batch id : 0 [62,1] element, prob = 0.0292969 (144,179)-(170,205) batch id : 0 [63,1] element, prob = 0.0292969 (139,189)-(168,215) batch id : 0 [64,1] element, prob = 0.0292969 (113,202)-(160,236) batch id : 0 [65,1] element, prob = 0.0292969 (609,120)-(654,195) batch id : 0 [66,1] element, prob = 0.0283203 (111,172)-(132,193) batch id : 0 [67,1] element, prob = 0.0283203 (147,184)-(165,200) batch id : 0 [68,1] element, prob = 0.0283203 (97,191)-(119,211) batch id : 0 [69,1] element, prob = 0.0283203 (142,202)-(164,222) batch id : 0 [70,1] element, prob = 0.0283203 (385,64)-(417,97) batch id : 0 [71,1] element, prob = 0.0283203 (71,175)-(108,205) batch id : 0 [72,1] element, prob = 0.0283203 (91,47)-(150,99) batch id : 0 [73,1] element, prob = 0.0273438 (162,163)-(180,180) batch id : 0 [74,1] element, prob = 0.0273438 (174,159)-(197,180) batch id : 0 [75,1] element, prob = 0.0273438 (99,185)-(117,200) batch id : 0 [76,1] element, prob = 0.0273438 (94,212)-(118,232) batch id : 0 [77,1] element, prob = 0.0273438 (102,128)-(147,159) batch id : 0 [78,1] element, prob = 0.0273438 (60,168)-(86,208) batch id : 0 [79,1] element, prob = 0.0273438 (60,186)-(85,218) batch id : 0 [80,1] element, prob = 0.0273438 (74,186)-(106,218) batch id : 0 [81,1] element, prob = 0.0268555 (97,173)-(114,190) batch id : 0 [82,1] element, prob = 0.0268555 (171,182)-(198,202) batch id : 0 [83,1] element, prob = 0.0268555 (161,192)-(180,210) batch id : 0 [84,1] element, prob = 0.0268555 (139,211)-(164,231) batch id : 0 [85,1] element, prob = 0.0268555 (123,222)-(147,238) batch id : 0 [86,1] element, prob = 0.0268555 (351,70)-(393,124) batch id : 0 [87,1] element, prob = 0.0268555 (110,136)-(154,169) batch id : 0 [88,1] element, prob = 0.0268555 (147,125)-(191,168) batch id : 0 [89,1] element, prob = 0.0268555 (47,153)-(74,190) batch id : 0 [ INFO ] Image out_0.bmp created! total inference time: 87.0158 Average running time of one iteration: 87.0158 ms Throughput: 11.4922 FPS [ INFO ] Execution successful
The third test is made on an image taken from a cartoon with rather "realistic" human characters. Will they be recognized by the neural network?
[ INFO ] InferenceEngine: API version ............ 1.6 Build .................. 22443 Parsing input parameters [ INFO ] Files were added: 1 [ INFO ] /home/pi/simpsons1.jpg [ INFO ] Loading plugin API version ............ 1.6 Build .................. 22443 Description ....... myriadPlugin [ 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 plugin [ WARNING ] Image is resized from (631, 368) to (672, 384) [ INFO ] Batch size is 1 [ INFO ] Start inference (1 iterations) [ INFO ] Processing output blobs [0,1] element, prob = 0.999512 (396,3)-(435,64) batch id : 0 WILL BE PRINTED! [1,1] element, prob = 0.992188 (503,19)-(542,73) batch id : 0 WILL BE PRINTED! [2,1] element, prob = 0.800293 (440,1)-(490,56) batch id : 0 WILL BE PRINTED! [3,1] element, prob = 0.383789 (515,68)-(584,144) batch id : 0 [4,1] element, prob = 0.186523 (327,106)-(391,172) batch id : 0 [5,1] element, prob = 0.162598 (529,13)-(578,73) batch id : 0 [6,1] element, prob = 0.0908203 (343,0)-(389,56) batch id : 0 [7,1] element, prob = 0.0908203 (251,13)-(331,92) batch id : 0 [8,1] element, prob = 0.0776367 (483,12)-(529,71) batch id : 0 [9,1] element, prob = 0.0717773 (138,3)-(194,98) batch id : 0 [10,1] element, prob = 0.0639648 (549,12)-(588,66) batch id : 0 [11,1] element, prob = 0.0581055 (419,3)-(472,62) batch id : 0 [12,1] element, prob = 0.0546875 (281,81)-(336,144) batch id : 0 [13,1] element, prob = 0.0527344 (501,35)-(567,116) batch id : 0 [14,1] element, prob = 0.0473633 (352,8)-(381,42) batch id : 0 [15,1] element, prob = 0.0463867 (272,36)-(340,101) batch id : 0 [16,1] element, prob = 0.0449219 (317,34)-(379,105) batch id : 0 [17,1] element, prob = 0.0449219 (146,10)-(274,156) batch id : 0 [18,1] element, prob = 0.0429688 (272,21)-(320,75) batch id : 0 [19,1] element, prob = 0.0429688 (282,-3)-(335,74) batch id : 0 [20,1] element, prob = 0.0395508 (328,-12)-(378,63) batch id : 0 [21,1] element, prob = 0.0385742 (427,-2)-(458,34) batch id : 0 [22,1] element, prob = 0.0385742 (441,28)-(490,106) batch id : 0 [23,1] element, prob = 0.0366211 (218,29)-(290,104) batch id : 0 [24,1] element, prob = 0.0366211 (420,97)-(496,188) batch id : 0 [25,1] element, prob = 0.0356445 (589,-17)-(635,61) batch id : 0 [26,1] element, prob = 0.0356445 (265,64)-(318,146) batch id : 0 [27,1] element, prob = 0.0356445 (264,16)-(557,330) batch id : 0 [28,1] element, prob = 0.034668 (293,106)-(362,164) batch id : 0 [29,1] element, prob = 0.0341797 (388,15)-(431,91) batch id : 0 [30,1] element, prob = 0.0332031 (549,0)-(578,37) batch id : 0 [31,1] element, prob = 0.0332031 (346,33)-(403,105) batch id : 0 [32,1] element, prob = 0.0332031 (138,41)-(191,132) batch id : 0 [33,1] element, prob = 0.0332031 (21,10)-(292,332) batch id : 0 [34,1] element, prob = 0.0322266 (548,40)-(580,90) batch id : 0 [35,1] element, prob = 0.0322266 (151,43)-(230,103) batch id : 0 [36,1] element, prob = 0.0322266 (472,72)-(517,153) batch id : 0 [37,1] element, prob = 0.03125 (344,9)-(369,35) batch id : 0 [38,1] element, prob = 0.03125 (553,-2)-(611,63) batch id : 0 [39,1] element, prob = 0.03125 (154,75)-(225,133) batch id : 0 [40,1] element, prob = 0.03125 (373,104)-(439,171) batch id : 0 [41,1] element, prob = 0.0302734 (535,-3)-(564,32) batch id : 0 [42,1] element, prob = 0.0292969 (357,26)-(376,47) batch id : 0 [43,1] element, prob = 0.0292969 (364,-1)-(394,36) batch id : 0 [44,1] element, prob = 0.0292969 (316,116)-(369,181) batch id : 0 [45,1] element, prob = 0.0292969 (117,4)-(170,93) batch id : 0 [46,1] element, prob = 0.0283203 (341,0)-(363,22) batch id : 0 [47,1] element, prob = 0.0283203 (356,0)-(380,25) batch id : 0 [48,1] element, prob = 0.0283203 (411,-4)-(442,41) batch id : 0 [49,1] element, prob = 0.0283203 (303,128)-(350,185) batch id : 0 [50,1] element, prob = 0.0283203 (474,39)-(530,107) batch id : 0 [51,1] element, prob = 0.0283203 (451,106)-(517,171) batch id : 0 [52,1] element, prob = 0.0273438 (462,0)-(482,19) batch id : 0 [53,1] element, prob = 0.0273438 (324,142)-(349,176) batch id : 0 [ INFO ] Image out_0.bmp created! total inference time: 86.8039 Average running time of one iteration: 86.8039 ms Throughput: 11.5202 FPS [ INFO ] Execution successful
In this case, an image with some characters from The Simpsons cartoon series, the neural network provides three positive results. We note that the three recognized faces are in the background and of reduced size.
We used our Raspberry with the Intel Neural Compute Stick 2 for the recognition of faces within an image. This is a pretty simple task so let's move on to testing NCS2 in a more complex problem. Let's consider video analysis.
The point that left me most doubtful was the possibility of using our Raspberry pi4 system and Intel Neural Compute Stick 2 to solve more complex Artificial Intelligence applications.
The second example we want to test with our Raspberry pi4 + Intel Neural Compute Stick 2 system is the classic face recognition application in real-time. Many examples on the web use videos for testing and I myself started my tests using short videos but the most interesting practical applications are those in real-time.
This time we will have to deal with video information that must be analyzed in real-time so we will keep under control the temperature reached by the Raspberry, the percentage of processor and RAM used after continuous use over time.
In fact, I'm curious to see if our system continues to work without problems or if there will be a decrease in performance. We know that the Raspberry, in particular situations, for example in case of excessive heating, could protect itself by throttling its CPU.
We used a USB webcam for the tests, we used the "object_detection_demo_ssd_async " example and we followed the same sequence of operations already seen previously.
First the command:
make -j2 object_detection_demo_ssd_async
from inside the folder:
inference_engine_vpu_arm / deployment_tools / inference_engine / samples / build
Then:
./armv7l/Release/object_detection_demo_ssd_async -m face-detection-adas-0001.xml -d MYRIAD -i cam -r
The result was very satisfactory because our system worked correctly by recognizing faces even from less than optimal angles.
My Raspberry is equipped with heatsinks and a small fan but it certainly wasn't made to dissipate a lot of energy. The CPU temperature, after 40 minutes of use, has stabilized around 45°C and we have a CPU usage of about 15%. RAM usage is also quite limited and almost consistently under 250MB. Also, Intel NCS2 temperature was around 46°C so I can say that the system can perform the analysis of a video in real-time without excessive problems.
We also used it at school, and in the classroom, we got high recognition rates, even when the students weren't facing the webcam.
In this work, however, I published a video that shows the recognition of faces in a situation that does not produce privacy problems: I framed television with my webcam where a cooking program was being broadcast. The video unfortunately has poor quality due to the low frame rate with which the capture software captured the video from my PC desktop. I must say that on the Raspberry there are no video quality problems.
In this video, you will be able to simultaneously see both the video output produced by the system with the faces highlighted, and the percentage of CPU and RAM used.
The purpose of this roadtest, in addition to testing the functionality of the Intel Neural Compute Stick 2, is to give my students hardware that can help them discover the problems related to artificial intelligence and that, I hope, can intrigue them.
Our school participates in several robotics contests such as the Robocup Junior and the NaoChallenge and in the competitions students have to solve practical problems so it could be very useful to know how to use Artificial Intelligence.
For these and other competitions we frequently use the Raspberry pi3 or pi4 for small size, low power consumption, simple management. Today, thanks to the Intel Neural Compute Stick 2, we can solve simple Artificial Intelligence problems such as the recognition of objects or people in real-time.
I showed the system to my students (last year of secondary school, around 18 years old) and showed them the possibilities of this technology.
We saw the example of face recognition in action together and the students were very impressed with the accuracy of the recognition and the fluidity of processing.
There have been many proposals made by young people on the subject of Covid 19: one thought of using this technology to detect gatherings in the classroom (in Italy we returned to the classroom a week ago, after months of remote teaching): imagine a small box placed on the wall of the classroom that signals with an acoustic alarm dangerous situations such as mask not worn or reduced distances between students.
Another thought about using this technology to blur faces from videos or photographs when this is needed for privacy reasons. Another student proposed to use this system to allow access only to recognized users in places where security is essential.
At the end of this roadtest I will leave the Intel Neural Compute Stick 2 to two students so that they can carry out their end-of-school project using it in Artificial Intelligence projects and by July I will publish their work.
Thanks to Intel because using this device, I was able to introduce new and highly requested technologies to my students. Coupled to a Raspberry we obtain a versatile, powerful, and simple to use system with an extremely reduced occupied space and low energy consumption.
I conclude this roadtest by saying that it was very interesting to use the Intel NCS2. I have to commend Intel for the accurate and complete documentation and for the countless examples that can be found on the Internet. The installation and configuration phase of the necessary software on the Raspberry is also well described and takes place without excessive difficulties.
Its cost-performance ratio could convince many schools to use it for the purpose of introducing AI to students.
I must admit that in the months I had the Intel NCS2 at home, I never used it on my PC, I was dreaming of a small, versatile, and low-power system and, to me, this pair (Raspberry + NCS2) is fantastic.
As usual, when dealing with technologies of this type, the applications are endless, the only limit is our imagination, so I am always waiting for new applications and increasingly interesting and useful examples.
I thank Intel and Elements14 for the opportunity they gave me and I thank all the members of the community who are now a constant company of my evenings at home with their projects and their ideas.
Top Comments
A good roadtest, with some interesting results.
Dubbie
Thanks, Dubbie
Carlo