OpenVINO+ NCS2
2019年12月2日 - 未分類
Movidius Neural Compute Stick2(NSC2)は、USB3.0 対応なのですが、Raspberry Pi Model 3+までUSB2.0にしか対応していませんでした。USB3.0に対応したRaspberry Pi Model 4が入手できたので、改めて、Movidius Neural Compute Stick2を試してみました。
先ずは、openVINOのダウンロードからです。
Intelのページから、l_openvino_toolkit_runtime_raspbian_p_2019.3.334.tgz をダウンロードします。
/opt/intel/openvinoに展開します。
これには、TBBが入っておらずエラーになるので、TBBもダウンロードしてコンパイルしておきます。
ここから、ソースコードをダウンロードしてコンパイルします。
$ tar zxvf 2019_U9.tar.gz
$ cd tbb-2019_U9/
$ make
$ cp build/linux_armv7_gcc_cc8.3.0_libc2.28_kernel4.19.75_release/libtbb* /opt/intel/openvino/deployment_tools/inference_engine/external/tbb/lib/
$mkdir ~/open_sample
$cd ~open_sample
$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=”-march=armv7-a” /opt/intel/openvino/deployment_tools/inference_engine/samples
$ make -j 2
$ cd armv7l/Release
$./benchmark_app -i ~/president_reagan-62×62.png -m ~/models/age-gender-recognition-retail-0013.xml -api async -d MYRIAD
[Step 1/11] Parsing and validating input arguments
[ INFO ] Parsing input parameters
[ INFO ] Files were added: 1
[ INFO ] /home/pi/president_reagan-62x62.png
[ WARNING ] -nstreams default value is determined automatically for a device. Although the automatic selection usually provides a reasonable performance,but it still may be non-optimal for some cases, for more information look at README.
[Step 2/11] Loading Inference Engine
[ INFO ] InferenceEngine:
API version ............ 2.1
Build .................. custom_releases/2019/R3_cb6cad9663aea3d282e0e8b3e0bf359df665d5d0
Description ....... API
[ INFO ] Device info:
MYRIAD
myriadPlugin version ......... 2.1
Build ........... 30677
[Step 3/11] Reading the Intermediate Representation network
[ INFO ] Loading network files
[ INFO ] Read network took 35.00 ms
[Step 4/11] Resizing network to match image sizes and given batch
[ INFO ] Network batch size: 1, precision: FP16
[Step 5/11] Configuring input of the model
[Step 6/11] Setting device configuration
[Step 7/11] Loading the model to the device
[ INFO ] Load network took 1918.22 ms
[Step 8/11] Setting optimal runtime parameters
[Step 9/11] Creating infer requests and filling input blobs with images
[ INFO ] Network input 'data' precision U8, dimensions (NCHW): 1 3 62 62
[ WARNING ] Some image input files will be duplicated: 4 files are required but only 1 are provided
[ INFO ] Infer Request 0 filling
[ INFO ] Prepare image /home/pi/president_reagan-62x62.png
libpng warning: iCCP: known incorrect sRGB profile
[ INFO ] Infer Request 1 filling
[ INFO ] Prepare image /home/pi/president_reagan-62x62.png
libpng warning: iCCP: known incorrect sRGB profile
[ INFO ] Infer Request 2 filling
[ INFO ] Prepare image /home/pi/president_reagan-62x62.png
libpng warning: iCCP: known incorrect sRGB profile
[ INFO ] Infer Request 3 filling
[ INFO ] Prepare image /home/pi/president_reagan-62x62.png
libpng warning: iCCP: known incorrect sRGB profile
[Step 10/11] Measuring performance (Start inference asyncronously, 4 inference requests, limits: 60000 ms duration)
[Step 11/11] Dumping statistics report
Count: 27720 iterations
Duration: 60013.63 ms
Latency: 8.43 ms
Throughput: 461.90 FPS
何をやっているのか分からんが、多分、すごく早いのでしょうね。。。
pi@rpi4:~/open_sample $ time ./armv7l/Release/object_detection_sample_ssd -m ../models/face-detection-adas-0001.xml -d MYRIAD -i ../president_reagan-62×62.png
[ INFO ] InferenceEngine:
API version ………… 2.1
Build ……………… custom_releases/2019/R3_cb6cad9663aea3d282e0e8b3e0bf359df665d5d0
Description ……. API
Parsing input parameters
[ INFO ] Files were added: 1
[ INFO ] ../president_reagan-62×62.png
[ INFO ] Loading Inference Engine
[ INFO ] Device info:
MYRIAD
myriadPlugin version ……… 2.1
Build ……….. 30677
[ INFO ] Loading network files:
../models/face-detection-adas-0001.xml
../models/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
libpng warning: iCCP: known incorrect sRGB profile
[ WARNING ] Image is resized from (62, 62) to (672, 384)
[ INFO ] Batch size is 1
[ INFO ] Start inference
[ INFO ] Processing output blobs
[0,1] element, prob = 0.998047 (26,14)-(47,43) batch id : 0 WILL BE PRINTED!
[1,1] element, prob = 0.103516 (14,15)-(19,22) batch id : 0
[2,1] element, prob = 0.078125 (30,54)-(33,62) batch id : 0
[3,1] element, prob = 0.0517578 (15,17)-(18,21) batch id : 0
[4,1] element, prob = 0.0483398 (14,16)-(17,21) batch id : 0
[5,1] element, prob = 0.0405273 (31,43)-(37,52) batch id : 0
[6,1] element, prob = 0.0395508 (30,58)-(32,62) batch id : 0
[7,1] element, prob = 0.0375977 (15,15)-(17,18) batch id : 0
[8,1] element, prob = 0.0375977 (15,20)-(17,23) batch id : 0
[9,1] element, prob = 0.0375977 (31,48)-(36,58) batch id : 0
[10,1] element, prob = 0.0375977 (0,0)-(7,35) batch id : 0
[11,1] element, prob = 0.0366211 (1,0)-(5,14) batch id : 0
[12,1] element, prob = 0.0366211 (12,14)-(19,22) batch id : 0
[13,1] element, prob = 0.0356445 (17,15)-(19,18) batch id : 0
[14,1] element, prob = 0.034668 (17,17)-(19,21) batch id : 0
[15,1] element, prob = 0.034668 (30,56)-(32,60) batch id : 0
[16,1] element, prob = 0.034668 (29,0)-(34,4) batch id : 0
[17,1] element, prob = 0.0341797 (14,15)-(16,18) batch id : 0
[18,1] element, prob = 0.0332031 (14,21)-(16,26) batch id : 0
[19,1] element, prob = 0.0332031 (0,0)-(5,7) batch id : 0
[20,1] element, prob = 0.0332031 (43,31)-(49,41) batch id : 0
[21,1] element, prob = 0.0332031 (14,7)-(22,21) batch id : 0
[22,1] element, prob = 0.0332031 (12,14)-(20,27) batch id : 0
[23,1] element, prob = 0.0322266 (26,6)-(29,11) batch id : 0
[24,1] element, prob = 0.0322266 (14,17)-(16,20) batch id : 0
[25,1] element, prob = 0.0322266 (14,12)-(19,20) batch id : 0
[26,1] element, prob = 0.0322266 (6,4)-(22,40) batch id : 0
[27,1] element, prob = 0.03125 (17,20)-(19,23) batch id : 0
[28,1] element, prob = 0.03125 (12,22)-(15,26) batch id : 0
[29,1] element, prob = 0.03125 (46,34)-(48,39) batch id : 0
[30,1] element, prob = 0.03125 (13,12)-(17,18) batch id : 0
[31,1] element, prob = 0.03125 (13,16)-(16,22) batch id : 0
[32,1] element, prob = 0.03125 (30,52)-(35,60) batch id : 0
[33,1] element, prob = 0.03125 (7,9)-(12,25) batch id : 0
[34,1] element, prob = 0.03125 (10,12)-(16,24) batch id : 0
[35,1] element, prob = 0.03125 (7,16)-(12,31) batch id : 0
[36,1] element, prob = 0.0302734 (45,32)-(47,37) batch id : 0
[37,1] element, prob = 0.0292969 (30,0)-(33,2) batch id : 0
[38,1] element, prob = 0.0292969 (45,35)-(47,39) batch id : 0
[39,1] element, prob = 0.0292969 (30,53)-(32,59) batch id : 0
[40,1] element, prob = 0.0292969 (14,0)-(19,6) batch id : 0
[41,1] element, prob = 0.0292969 (26,13)-(30,20) batch id : 0
[42,1] element, prob = 0.0292969 (28,14)-(32,21) batch id : 0
[43,1] element, prob = 0.0292969 (14,17)-(17,23) batch id : 0
[44,1] element, prob = 0.0292969 (11,19)-(16,28) batch id : 0
[45,1] element, prob = 0.0292969 (30,32)-(38,41) batch id : 0
[46,1] element, prob = 0.0292969 (24,1)-(32,14) batch id : 0
[47,1] element, prob = 0.0283203 (2,0)-(4,3) batch id : 0
[48,1] element, prob = 0.0283203 (25,14)-(28,19) batch id : 0
[49,1] element, prob = 0.0283203 (15,24)-(18,29) batch id : 0
[50,1] element, prob = 0.0283203 (29,57)-(31,62) batch id : 0
[51,1] element, prob = 0.0283203 (27,4)-(31,12) batch id : 0
[52,1] element, prob = 0.0283203 (13,14)-(16,19) batch id : 0
[53,1] element, prob = 0.0283203 (8,15)-(11,22) batch id : 0
[54,1] element, prob = 0.0283203 (10,21)-(14,28) batch id : 0
[55,1] element, prob = 0.0283203 (31,45)-(35,52) batch id : 0
[56,1] element, prob = 0.0283203 (10,6)-(15,19) batch id : 0
[57,1] element, prob = 0.0273438 (33,0)-(35,3) batch id : 0
[58,1] element, prob = 0.0273438 (2,6)-(4,11) batch id : 0
[59,1] element, prob = 0.0273438 (8,9)-(10,14) batch id : 0
[60,1] element, prob = 0.0273438 (11,15)-(13,18) batch id : 0
[61,1] element, prob = 0.0273438 (11,17)-(13,21) batch id : 0
[62,1] element, prob = 0.0273438 (14,19)-(16,23) batch id : 0
[63,1] element, prob = 0.0273438 (11,22)-(13,26) batch id : 0
[64,1] element, prob = 0.0273438 (14,24)-(16,29) batch id : 0
[65,1] element, prob = 0.0273438 (27,57)-(30,62) batch id : 0
[66,1] element, prob = 0.0273438 (0,0)-(4,4) batch id : 0
[67,1] element, prob = 0.0273438 (32,0)-(35,5) batch id : 0
[68,1] element, prob = 0.0273438 (27,5)-(30,10) batch id : 0
[69,1] element, prob = 0.0273438 (14,8)-(17,13) batch id : 0
[70,1] element, prob = 0.0273438 (8,12)-(11,19) batch id : 0
[71,1] element, prob = 0.0273438 (16,13)-(21,21) batch id : 0
[72,1] element, prob = 0.0273438 (24,12)-(29,21) batch id : 0
[73,1] element, prob = 0.0273438 (10,17)-(14,26) batch id : 0
[74,1] element, prob = 0.0273438 (12,18)-(15,24) batch id : 0
[75,1] element, prob = 0.0273438 (15,20)-(18,27) batch id : 0
[76,1] element, prob = 0.0273438 (12,23)-(15,30) batch id : 0
[77,1] element, prob = 0.0273438 (43,30)-(47,38) batch id : 0
[78,1] element, prob = 0.0273438 (29,49)-(34,59) batch id : 0
[79,1] element, prob = 0.0273438 (31,50)-(34,57) batch id : 0
[80,1] element, prob = 0.0268555 (29,1)-(32,5) batch id : 0
[81,1] element, prob = 0.0268555 (31,1)-(34,5) batch id : 0
[82,1] element, prob = 0.0268555 (26,15)-(28,18) batch id : 0
[83,1] element, prob = 0.0268555 (11,20)-(13,23) batch id : 0
[84,1] element, prob = 0.0268555 (16,22)-(17,26) batch id : 0
[85,1] element, prob = 0.0268555 (43,30)-(46,34) batch id : 0
[86,1] element, prob = 0.0268555 (45,30)-(47,34) batch id : 0
[87,1] element, prob = 0.0268555 (46,31)-(49,36) batch id : 0
[88,1] element, prob = 0.0268555 (43,35)-(46,39) batch id : 0
[89,1] element, prob = 0.0268555 (3,3)-(6,13) batch id : 0
[90,1] element, prob = 0.0268555 (26,7)-(29,14) batch id : 0
[91,1] element, prob = 0.0268555 (12,11)-(15,16) batch id : 0
[92,1] element, prob = 0.0268555 (26,11)-(30,18) batch id : 0
[93,1] element, prob = 0.0268555 (11,19)-(13,24) batch id : 0
[94,1] element, prob = 0.0268555 (16,17)-(19,23) batch id : 0
[95,1] element, prob = 0.0268555 (33,17)-(41,26) batch id : 0
[96,1] element, prob = 0.0268555 (8,23)-(11,29) batch id : 0
[97,1] element, prob = 0.0268555 (13,18)-(18,27) batch id : 0
[98,1] element, prob = 0.0268555 (29,0)-(36,7) batch id : 0
[99,1] element, prob = 0.0268555 (30,39)-(37,49) batch id : 0
[100,1] element, prob = 0.0268555 (3,0)-(13,34) batch id : 0
[101,1] element, prob = 0.0268555 (39,-1)-(61,19) batch id : 0
[102,1] element, prob = 0.0258789 (28,0)-(32,3) batch id : 0
[103,1] element, prob = 0.0258789 (27,5)-(29,8) batch id : 0
[104,1] element, prob = 0.0258789 (14,7)-(16,11) batch id : 0
[105,1] element, prob = 0.0258789 (14,9)-(16,13) batch id : 0
[106,1] element, prob = 0.0258789 (9,12)-(11,15) batch id : 0
[107,1] element, prob = 0.0258789 (14,12)-(16,16) batch id : 0
[108,1] element, prob = 0.0258789 (24,12)-(26,16) 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
real 0m4.920s
user 0m2.755s
sys 0m0.539s