{"id":1282,"date":"2020-11-20T13:37:55","date_gmt":"2020-11-20T05:37:55","guid":{"rendered":"http:\/\/blog.zengqq.com.cn\/?p=1282"},"modified":"2020-11-22T22:17:46","modified_gmt":"2020-11-22T14:17:46","slug":"%e5%9c%a8%e6%a0%91%e8%8e%93%e6%b4%be3b%e4%b8%8a%e9%83%a8%e7%bd%b2intel-ncs2%e7%a5%9e%e7%bb%8f%e7%bd%91%e7%bb%9c%e8%ae%a1%e7%ae%97%e6%a3%92","status":"publish","type":"post","link":"https:\/\/blog.zengqq.com.cn\/?p=1282","title":{"rendered":"\u5728\u6811\u8393\u6d3e3B+\u4e0a\u90e8\u7f72Intel NCS2\u795e\u7ecf\u7f51\u7edc\u8ba1\u7b97\u68d2"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">\u5728\u6811\u8393\u6d3e3B+\u4e0a\u90e8\u7f72Intel NCS2\u795e\u7ecf\u7f51\u7edc\u8ba1\u7b97\u68d2<\/h1>\n\n\n\n<p><a href=\"http:\/\/www.osse.top\/archives\/category\/raspi\">RASPI<\/a>&nbsp;2019-01-14 10:06248(\u8f6c\u53d1\uff09<\/p>\n\n\n\n<p>2018.12.20\u65e5 \u82f1\u7279\u5c14\u66f4\u65b0\u4e86OpenVINO Toolkit R5\u7248\u672c\u3002\u8be5\u7248\u672c\u6dfb\u52a0\u4e86\u5bf9\u6811\u8393\u6d3e\u7684\u652f\u6301\u3002\u4f5c\u4e3aNCS2\u7684\u5b98\u65b9\u5f00\u53d1\u5957\u4ef6\uff0cOpenVINO\u5728\u6b64\u4e4b\u524d\u53ea\u80fd\u5728\u53f0\u5f0f\u673aubuntu 16.04\u4e0a\u4f7f\u7528\u3002\u800c\u5728\u6811\u8393\u6d3e\u4e0a\u4f7f\u7528\u7684ncsdk\u5e76\u4e0d\u652f\u6301NCS2\u8ba1\u7b97\u68d2\u3002\u901a\u8fc7\u5728\u6811\u8393\u6d3e\u4e0a\u90e8\u7f72OpenVino\uff0c\u53ef\u5b9e\u73b0\u5728\u6811\u8393\u6d3e\u4e0a\u4f7f\u7528NCS2\u52a0\u901f\u795e\u7ecf\u7f51\u7edc\u8ba1\u7b97\u3002<\/p>\n\n\n\n<p>\u672c\u535a\u5ba2\u4f9d\u7167\u5b98\u65b9\u8d44\u6599\u7f16\u5199\uff0c\u535a\u4e3b\u5728\u786e\u8ba4\u53ef\u884c\uff08\u6392\u96f7\uff09\u540e\uff0c\u7b2c\u4e00\u65f6\u95f4\u5199\u4e0b\u6b64\u535a\u6587\u3002\u5b98\u65b9\u94fe\u63a5\uff1a<br><a href=\"https:\/\/software.intel.com\/en-us\/articles\/OpenVINO-Install-RaspberryPI#install-the-package\">https:\/\/software.intel.com\/en-us\/articles\/OpenVINO-Install-RaspberryPI#install-the-package<\/a><\/p>\n\n\n\n<p>\u7cfb\u7edf\u8981\u6c42\uff1a<br>\u4f60\u9700\u8981\u4e00\u4e2a\u5b89\u88c5\u4e86Raspbian 9 OS 32\u4f4d\uff0c\u4e5f\u5c31\u662f\u5b98\u65b9\u7cfb\u7edf\u7684\u6811\u8393\u6d3e3B+\u3002<\/p>\n\n\n\n<p>\u6ce8\u610f\u4e8b\u9879\uff1a<br>\u4e00\u822c\u6765\u8bf4\uff0c \u6240\u6709\u7684\u6b65\u9aa4\u90fd\u662f\u4e0d\u53ef\u6216\u7f3a\u7684\uff0c\u9664\u975e\u60a8\u5728\u4e4b\u524d\u5df2\u7ecf\u90e8\u7f72\u8fc7\u4e86\u4e00\u4e9b\u6a21\u5757\u3002<br>OpenVINO toolkit for Raspbian OS \u53ea\u5305\u542b\u4e86MYRIAD\u63d2\u4ef6\u3002<\/p>\n\n\n\n<p>\u603b\u4f53\u6b65\u9aa4\uff1a<br>\u5b89\u88c5Intel\u00ae\ufe0f Distribution of OpenVINO\u2122\ufe0f toolkit\u3002<br>\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u3002<br>\u6dfb\u52a0USB\u89c4\u5219\u3002<br>\u8fd0\u884c\u4f8b\u7a0b\u786e\u8ba4\u5b89\u88c5\u6b63\u786e\u3002<br>\u5b89\u88c5\u5305\u6240\u542b\u5185\u5bb9\uff1a<br>1.\u63a8\u7406\u5f15\u64ce<br>2.OpenCV 4.0<br>3.\u6837\u672c\u4ee3\u7801<\/p>\n\n\n\n<p>\u5b89\u88c5\u6b65\u9aa4\uff1a<br>\u4e0b\u8f7dIntel\u00ae\ufe0f Distribution of OpenVINO\u2122\ufe0f toolkit\u3002<br>\uff08\u6b64\u5904\u9ed8\u8ba4\u4e0b\u8f7d\u76ee\u5f55\uff0c\u5b89\u88c5\u76ee\u5f55\u4e3a\uff5e\/Downloads\uff09<\/p>\n\n\n\n<p>\u6253\u5f00\u7ec8\u7aef\uff1a<\/p>\n\n\n\n<p>\u81f3\u6b64\uff0cNCS2\u73af\u5883\u90e8\u7f72\u5df2\u5b8c\u6210\u3002\u6211\u4eec\u4f7f\u7528\u5b98\u65b9\u4f8b\u7a0b\u8fdb\u884c\u9a8c\u8bc1\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>12345678910111213141516<\/td><td>1.\u8f6c\u5230\u5305\u542b\u793a\u4f8b\u6e90\u7801\u7684\u6587\u4ef6\u5939\uff1acd inference_engine_vpu_arm\/deployment_tools\/inference_engine\/samples&nbsp;2.\u65b0\u5efa\u6587\u4ef6\u5939build\uff1amkdir build &amp;amp;&amp;amp; cd build&nbsp;3.\u6784\u5efa\u5bf9\u8c61\u68c0\u6d4b\u793a\u4f8b\uff1acmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=&#8221;-march=armv7-a&#8221;make -j4 object_detection_sample_ssd&nbsp;4.\u4e0b\u8f7d\u9884\u5148\u8bad\u7ec3\u7684\u4eba\u8138\u68c0\u6d4b\u6a21\u578b\uff1awget &#8211;no-check-certificate https:\/\/download.01.org\/openvinotoolkit\/2018_R4\/open_model_zoo\/face-detection-adas-0001\/FP16\/face-detection-adas-0001.binwget &#8211;no-check-certificate https:\/\/download.01.org\/openvinotoolkit\/2018_R4\/open_model_zoo\/face-detection-adas-0001\/FP16\/face-detection-adas-0001.xml&nbsp;5.\u8fd0\u884c\u793a\u4f8b\u6d4b\u8bd5\u7ed3\u679c\uff1a\uff08path_to_image \u4e3a\u5e26\u4eba\u8138\u7684\u56fe\u7247\u8def\u5f84\uff09.\/armv7l\/Release\/object_detection_sample_ssd -m face-detection-adas-0001.xml -d MYRIAD -i &amp;lt;path_to_image&gt;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u4f7f\u7528OpenCV API\u8fd0\u884c\u4eba\u8138\u68c0\u6d4b\u6a21\u578b<\/h3>\n\n\n\n<p>\u65b0\u5efa\u4e00\u4e2a\u540d\u4e3aopenvino_fd_myriad.py\u7684\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a\uff08\u2019\/path\/to\/image\u2018\u66ff\u6362\u4e3a\u56fe\u7247\u7edd\u5bf9\u8def\u5f84\uff09&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>12345678910111213141516171819202122232425262728<\/td><td>import cv2 as cv&nbsp;# Load the model net = cv.dnn.readNet(&#8216;face-detection-adas-0001.xml&#8217;, &#8216;face-detection-adas-0001.bin&#8217;) &nbsp;# Specify target device net.setPreferableTarget(cv.dnn.DNN_TARGET_MYRIAD)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Read an image frame = cv.imread(&#8216;\/path\/to\/image&#8217;)&nbsp;&nbsp;# Prepare input blob and perform an inference blob = cv.dnn.blobFromImage(frame, size=(672, 384), ddepth=cv.CV_8U) net.setInput(blob) out = net.forward()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Draw detected faces on the frame for detection in out.reshape(-1, 7): &nbsp;&nbsp;&nbsp;&nbsp;confidence = float(detection[2]) &nbsp;&nbsp;&nbsp;&nbsp;xmin = int(detection[3] * frame.shape[1]) &nbsp;&nbsp;&nbsp;&nbsp;ymin = int(detection[4] * frame.shape[0]) &nbsp;&nbsp;&nbsp;&nbsp;xmax = int(detection[5] * frame.shape[1]) &nbsp;&nbsp;&nbsp;&nbsp;ymax = int(detection[6] * frame.shape[0])&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if confidence &gt; 0.5:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cv.rectangle(frame, (xmin, ymin), (xmax, ymax), color=(0, 255, 0))&nbsp;# Save the frame to an image file cv.imwrite(&#8216;out.png&#8217;, frame)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7136\u540e\u8fd0\u884c\u811a\u672c&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td>python3 openvino_fd_myriad.py<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u4ee5\u4e0a\u5b8c\u6210\u540e\uff0c\u4fbf\u6210\u529f\u5728\u6811\u8393\u6d3e\u4e0a\u90e8\u7f72NCS2\u8ba1\u7b97\u68d2\u7684\u8fd0\u884c\u73af\u5883\u4e86\u3002\u6587\u7ae0\u6807\u7b7e\uff1a&nbsp;&nbsp;<a href=\"http:\/\/www.osse.top\/archives\/tag\/ncs%e8%ae%a1%e7%ae%97%e6%a3%92\">NCS\u8ba1\u7b97\u68d2<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u6811\u8393\u6d3e3B+\u4e0a\u90e8\u7f72Intel NCS2\u795e\u7ecf\u7f51\u7edc\u8ba1 [&#8230;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[89],"tags":[159,160,161,163,162,156,60,157,158],"class_list":["post-1282","post","type-post","status-publish","format-standard","hentry","category-live","tag-intel","tag-ncs2","tag-ncsdk","tag-opencv-4-0","tag-openvino","tag-156","tag-60","tag-157","tag-158"],"_links":{"self":[{"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/1282","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1282"}],"version-history":[{"count":2,"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/1282\/revisions"}],"predecessor-version":[{"id":1356,"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/1282\/revisions\/1356"}],"wp:attachment":[{"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}