OpenVINO™

  • 下载树莓派使用的 OpenVINO™ 工具包
  • 创建安装文件夹
  • 安装外部软件依赖项
  • 设置环境变量
  • 为英特尔神经计算棒 2 设备添加 USB 规则
  • 构建并运行对象检测示例
  • 查看树莓派有哪些设备支持 OpenVINO
  • 踩坑:

组件:
Raspberry Pi 4B 8G

环境:

  • OpenVINO:2021.4.582
  • Python 3.7.3
  • g++ (Raspbian 8.3.0-6+rpi1) 8.3.0

官方文档:https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_raspbian.html

下载树莓派使用的 OpenVINO™ 工具包

https://storage.openvinotoolkit.org/repositories/openvino/packages/

根据需要选择合适的 l_openvino_toolkit_runtime_raspbian_p_\<version>.tgzOpenVINO 工具包

wget https://storage.openvinotoolkit.org/repositories/openvino/packages/2021.4/l_openvino_toolkit_runtime_raspbian_p_2021.4.582.tgz

pi@raspberrypi:~/Desktop $ wget https://storage.openvinotoolkit.org/repositories/openvino/packages/2021.4/l_openvino_toolkit_runtime_raspbian_p_2021.4.582.tgz
–2021-09-03 14:58:53-- https://storage.openvinotoolkit.org/repositories/openvino/packages/2021.4/l_openvino_toolkit_runtime_raspbian_p_2021.4.582.tgz
长度:28644606 (27M) [application/octet-stream]
正在保存至: “l_openvino_toolkit_runtime_raspbian_p_2021.4.582.tgz”
l_openvino_toolkit_runtime 100%[=======================================>] 27.32M 4.85MB/s 用时 6.9s
2021-09-03 14:59:02 (3.98 MB/s) - 已保存 “l_openvino_toolkit_runtime_raspbian_p_2021.4.582.tgz” [28644606/28644606])

下载好以后,如下图

创建安装文件夹

sudo mkdir -p /opt/intel/openvino_2021

将下载好的 OpenVINO™ 工具包 解压到该目录中

sudo tar -xf  l_openvino_toolkit_runtime_raspbian_p_2021.4.582.tgz --strip 1 -C /opt/intel/openvino_2021

安装外部软件依赖项

使用OpenVINO™ 工具包需要 CMake 版本 3.7.2 或更高版本。要安装CMake,需要打开终端窗口并运行以下命令:

sudo apt install cmake

设置环境变量

设置环境变量,才能编译和运行 OpenVINO 工具包应用程序。

运行以下脚本临时设置环境变量:

source /opt/intel/openvino_2021/bin/setupvars.sh

注:每次关闭树莓派时会删除 OpenVINO 环境变量。

可以按如下方式永久设置环境变量:

echo "source /opt/intel/openvino_2021/bin/setupvars.sh" >> ~/.bashrc

坏境变量设置成功后,每次打开一个新终端,都会看到以下内容:

[setupvars.sh] OpenVINO environment initialized

为英特尔神经计算棒 2 设备添加 USB 规则

将当前 Linux 用户添加到users组中:

sudo usermod -a -G users "pi"

注意:如果没有修改.bashrc永久设置环境变量,每次使用OpenVINO 需要运行:

source /opt/intel/openvino_2021/bin/setupvars.sh

在英特尔® 神经计算棒 2 上执行推理,需要安装运行install_NCS_udev_rules.sh脚本的 USB 规则:

sh /opt/intel/openvino_2021/install_dependencies/install_NCS_udev_rules.sh

pi@raspberrypi:~/Desktop $ sh /opt/intel/openvino_2021/install_dependencies/install_NCS_udev_rules.sh
Updating udev rules…
Udev rules have been successfully installed.

树莓派已经成功安装 OpenVINO™ 工具包,可以进行使用了。

构建并运行对象检测示例

按照以下步骤使用 OpenVINO 工具包中的推理引擎示例使用预训练的人脸检测模型。

创建build的目录并进入:

mkdir build && cd build

构建对象检测示例:

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=armv7-a" /opt/intel/openvino_2021/deployment_tools/inference_engine/samples/cpp

pi@raspberrypi:~ $ mkdir build && cd build
pi@raspberrypi:~/build $ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=armv7-a" /opt/intel/openvino_2021/deployment_tools/inference_engine/samples/cpp
– The C compiler identification is GNU 8.3.0
– The CXX compiler identification is GNU 8.3.0
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: /usr/bin/c++
– Check for working CXX compiler: /usr/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Looking for C++ include unistd.h
– Looking for C++ include unistd.h - found
– Looking for C++ include stdint.h
– Looking for C++ include stdint.h - found
– Looking for C++ include sys/types.h
– Looking for C++ include sys/types.h - found
– Looking for C++ include fnmatch.h
– Looking for C++ include fnmatch.h - found
– Looking for strtoll
– Looking for strtoll - found
– Configuring done
– Generating done
– Build files have been written to: /home/pi/build

在build 文件夹下生成了很多案例:

使用 make 编译 object_detection_sample_ssd 案例

make -j2 object_detection_sample_ssd

pi@raspberrypi:~/build $ make -j2 object_detection_sample_ssd
Scanning dependencies of target gflags_nothreads_static
[ 6%] Building CXX object thirdparty/gflags/CMakeFiles/gflags_nothreads_static.dir/src/gflags.cc.o
[ 13%] Building CXX object thirdparty/gflags/CMakeFiles/gflags_nothreads_static.dir/src/gflags_reporting.cc.o
[ 20%] Building CXX object thirdparty/gflags/CMakeFiles/gflags_nothreads_static.dir/src/gflags_completions.cc.o
[ 26%] Linking CXX static library …/…/armv7l/Release/lib/libgflags_nothreads.a
[ 26%] Built target gflags_nothreads_static
Scanning dependencies of target ie_samples_utils
[ 40%] Building CXX object common/utils/CMakeFiles/ie_samples_utils.dir/src/common.cpp.o
[ 40%] Building CXX object common/utils/CMakeFiles/ie_samples_utils.dir/src/args_helper.cpp.o
[ 46%] Building CXX object common/utils/CMakeFiles/ie_samples_utils.dir/src/slog.cpp.o
[ 53%] Linking CXX static library …/…/armv7l/Release/lib/libie_samples_utils.a
[ 53%] Built target ie_samples_utils
Scanning dependencies of target format_reader
[ 66%] Building CXX object common/format_reader/CMakeFiles/format_reader.dir/MnistUbyte.cpp.o
[ 66%] Building CXX object common/format_reader/CMakeFiles/format_reader.dir/bmp.cpp.o
[ 73%] Building CXX object common/format_reader/CMakeFiles/format_reader.dir/format_reader.cpp.o
[ 80%] Building CXX object common/format_reader/CMakeFiles/format_reader.dir/opencv_wrapper.cpp.o
[ 86%] Linking CXX shared library …/…/armv7l/Release/lib/libformat_reader.so
[ 86%] Built target format_reader
Scanning dependencies of target object_detection_sample_ssd
[ 93%] Building CXX object object_detection_sample_ssd/CMakeFiles/object_detection_sample_ssd.dir/main.cpp.o
[100%] Linking CXX executable …/armv7l/Release/object_detection_sample_ssd
[100%] Built target object_detection_sample_ssd
pi@raspberrypi:~/build $

使用模型下载器从github下载预训练的人脸检测模型:

git clone --depth 1 https://github.com/openvinotoolkit/open_model_zoo
cd open_model_zoo/tools/downloader
python3 -m pip install -r requirements.in
python3 downloader.py --name face-detection-adas-0001

pi@raspberrypi:~/build $ git clone --depth 1 https://github.com/openvinotoolkit/open_model_zoo
正克隆到 ‘open_model_zoo’…
remote: Enumerating objects: 2954, done.
remote: Counting objects: 100% (2954/2954), done.
remote: Compressing objects: 100% (2196/2196), done.
remote: Total 2954 (delta 898), reused 1572 (delta 637), pack-reused 0
接收对象中: 100% (2954/2954), 145.44 MiB | 2.55 MiB/s, 完成.
处理 delta 中: 100% (898/898), 完成.
正在检出文件: 100% (2448/2448), 完成.
pi@raspberrypi:~/build $ cd open_model_zoo/tools/downloader
pi@raspberrypi:~/build/open_model_zoo/tools/downloader $ python3 -m pip install -r requirements.in
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pyyaml>=5.4.1 (from -r requirements.in (line 1))
Downloading https://www.piwheels.org/simple/pyyaml/PyYAML-5.4.1-cp37-cp37m-linux_armv7l.whl (45kB)
100% |████████████████████████████████| 51kB 172kB/s
Collecting requests>=2.25.1 (from -r requirements.in (line 2))
Downloading https://files.pythonhosted.org/packages/92/96/144f70b972a9c0eabbd4391ef93ccd49d0f2747f4f6a2a2738e99e5adc65/requests-2.26.0-py2.py3-none-any.whl (62kB)
100% |████████████████████████████████| 71kB 326kB/s
Collecting charset-normalizer~=2.0.0; python_version >= “3” (from requests>=2.25.1->-r requirements.in (line 2))
Downloading https://files.pythonhosted.org/packages/33/53/b7f6126a2b9fd878b025fe3c40266cfaad696f312165008ce045bffa3fe7/charset_normalizer-2.0.4-py3-none-any.whl
Requirement already satisfied: idna<4,>=2.5; python_version >= “3” in /usr/lib/python3/dist-packages (from requests>=2.25.1->-r requirements.in (line 2)) (2.6)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3/dist-packages (from requests>=2.25.1->-r requirements.in (line 2)) (1.24.1)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests>=2.25.1->-r requirements.in (line 2)) (2018.8.24)
Installing collected packages: pyyaml, charset-normalizer, requests
The script normalizer is installed in ‘/home/pi/.local/bin’ which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed charset-normalizer-2.0.4 pyyaml-5.4.1 requests-2.26.0
pi@raspberrypi:~/build/open_model_zoo/tools/downloader $ python3 downloader.py --name face-detection-adas-0001
################|| Downloading face-detection-adas-0001 ||################

========== Downloading /home/pi/build/open_model_zoo/tools/downloader/intel/face-detection-adas-0001/FP32/face-detection-adas-0001.xml
… 100%, 231 KB, 265 KB/s, 0 seconds passed

========== Downloading /home/pi/build/open_model_zoo/tools/downloader/intel/face-detection-adas-0001/FP32/face-detection-adas-0001.bin
… 100%, 4113 KB, 1842 KB/s, 2 seconds passed

========== Downloading /home/pi/build/open_model_zoo/tools/downloader/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.xml
… 100%, 231 KB, 260 KB/s, 0 seconds passed

========== Downloading /home/pi/build/open_model_zoo/tools/downloader/intel/face-detection-adas-0001/FP16/face-detection-adas-0001.bin
… 100%, 2056 KB, 1249 KB/s, 1 seconds passed

========== Downloading /home/pi/build/open_model_zoo/tools/downloader/intel/face-detection-adas-0001/FP16-INT8/face-detection-adas-0001.xml
… 100%, 498 KB, 450 KB/s, 1 seconds passed

========== Downloading /home/pi/build/open_model_zoo/tools/downloader/intel/face-detection-adas-0001/FP16-INT8/face-detection-adas-0001.bin
… 100%, 1074 KB, 785 KB/s, 1 seconds passed

运行示例,指定模型、输入图像的路径以及与 树莓派 操作系统一起运行所需的 VPU:

格式:

./armv7l/Release/object_detection_sample_ssd -m <path_to_model>/face-detection-adas-0001.xml -d MYRIAD -i <path_to_image>

我在 build 目录下进行测试:

./armv7l/Release/object_detection_sample_ssd -m ./open_model_zoo/tools/downloader/intel/face-detection-adas-0001/FP32/face-detection-adas-0001.xml -d MYRIAD -i ./test.jpg

检测一张人脸图片后,程序输出一个图像 ( out_0.bmp),其中检测到的人脸被框出。

pi@raspberrypi:~/build $ ./armv7l/Release/object_detection_sample_ssd -m ./open_model_zoo/tools/downloader/intel/face-detection-adas-0001/FP32/face-detection-adas-0001.xml -d MYRIAD -i ./test.jpg
[ INFO ] InferenceEngine:
IE version … 2021.4.0
Build … 2021.4.0-3839-cd81789d294-releases/2021/4
Parsing input parameters
[ INFO ] Files were added: 1
[ INFO ] ./test.jpg
[ INFO ] Loading Inference Engine
[ INFO ] Device info:
MYRIAD
myriadPlugin version … 2021.4.0
Build … 2021.4.0-3839-cd81789d294-releases/2021/4
[ INFO ] Loading network files:
[ INFO ] ./open_model_zoo/tools/downloader/intel/face-detection-adas-0001/FP32/face-detection-adas-0001.xml
[ 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 (640, 640) to (672, 384)
[ INFO ] Batch size is 1
[ INFO ] Start inference
[ INFO ] Processing output blobs
[0,1] element, prob = 1 (150,111)-(540,610) batch id : 0 WILL BE PRINTED!
[1,1] element, prob = 0.0268555 (591,126)-(616,185) batch id : 0
[2,1] element, prob = 0.0258789 (587,137)-(620,217) batch id : 0
[3,1] element, prob = 0.0249023 (553,283)-(616,423) batch id : 0
[4,1] element, prob = 0.0219727 (561,50)-(580,82) batch id : 0
[5,1] element, prob = 0.0200195 (544,97)-(597,204) batch id : 0
[6,1] element, prob = 0.0200195 (571,117)-(610,190) batch id : 0
[7,1] element, prob = 0.0200195 (595,69)-(646,199) batch id : 0
[8,1] element, prob = 0.0200195 (514,192)-(608,278) batch id : 0
[9,1] element, prob = 0.0200195 (559,242)-(621,373) batch id : 0
[10,1] element, prob = 0.0200195 (601,278)-(644,441) batch id : 0
[11,1] element, prob = 0.019043 (577,52)-(597,83) batch id : 0
[12,1] element, prob = 0.019043 (562,100)-(581,138) batch id : 0
[13,1] element, prob = 0.019043 (577,101)-(596,135) batch id : 0
[14,1] element, prob = 0.019043 (594,100)-(612,133) batch id : 0
[15,1] element, prob = 0.019043 (416,-5)-(480,37) batch id : 0
[16,1] element, prob = 0.019043 (451,-4)-(508,37) batch id : 0
[17,1] element, prob = 0.019043 (555,82)-(587,153) batch id : 0
[18,1] element, prob = 0.019043 (617,213)-(641,280) batch id : 0
[19,1] element, prob = 0.019043 (595,122)-(644,241) batch id : 0
[20,1] element, prob = 0.019043 (596,234)-(651,354) batch id : 0
[21,1] element, prob = 0.0180664 (578,78)-(596,110) batch id : 0
[22,1] element, prob = 0.0180664 (593,76)-(613,115) batch id : 0
[23,1] element, prob = 0.0180664 (547,103)-(566,138) batch id : 0
[24,1] element, prob = 0.0180664 (555,8)-(591,70) batch id : 0
[25,1] element, prob = 0.0180664 (564,48)-(611,135) batch id : 0
[26,1] element, prob = 0.0180664 (586,218)-(615,293) batch id : 0
[27,1] element, prob = 0.0180664 (597,205)-(640,293) batch id : 0
[28,1] element, prob = 0.0180664 (533,294)-(593,436) batch id : 0
[29,1] element, prob = 0.0180664 (552,405)-(587,481) batch id : 0
[30,1] element, prob = 0.0170898 (562,128)-(581,167) batch id : 0
[31,1] element, prob = 0.0170898 (556,349)-(582,410) batch id : 0
[32,1] element, prob = 0.0170898 (555,36)-(586,93) batch id : 0
[33,1] element, prob = 0.0170898 (573,30)-(605,92) batch id : 0
[34,1] element, prob = 0.0170898 (556,64)-(586,124) batch id : 0
[35,1] element, prob = 0.0170898 (548,52)-(594,140) batch id : 0
[36,1] element, prob = 0.0170898 (530,70)-(580,172) batch id : 0
[37,1] element, prob = 0.0170898 (617,148)-(641,209) batch id : 0
[38,1] element, prob = 0.0170898 (586,177)-(618,269) batch id : 0
[39,1] element, prob = 0.0170898 (546,362)-(587,445) batch id : 0
[40,1] element, prob = 0.0170898 (570,364)-(599,456) batch id : 0
[41,1] element, prob = 0.0170898 (505,95)-(558,272) batch id : 0
[42,1] element, prob = 0.0170898 (564,173)-(625,300) batch id : 0
[43,1] element, prob = 0.0170898 (525,242)-(599,395) batch id : 0
[44,1] element, prob = 0.0161133 (414,-1)-(450,34) batch id : 0
[45,1] element, prob = 0.0161133 (433,-3)-(467,31) batch id : 0
[46,1] element, prob = 0.0161133 (449,-2)-(483,30) batch id : 0
[47,1] element, prob = 0.0161133 (477,0)-(515,38) batch id : 0
[48,1] element, prob = 0.0161133 (609,-4)-(630,29) batch id : 0
[49,1] element, prob = 0.0161133 (563,75)-(581,111) batch id : 0
[50,1] element, prob = 0.0161133 (577,128)-(596,169) batch id : 0
[51,1] element, prob = 0.0161133 (606,131)-(625,166) batch id : 0
[52,1] element, prob = 0.0161133 (621,129)-(640,171) batch id : 0
[53,1] element, prob = 0.0161133 (609,230)-(628,266) batch id : 0
[54,1] element, prob = 0.0161133 (573,325)-(598,383) batch id : 0
[55,1] element, prob = 0.0161133 (542,376)-(567,433) batch id : 0
[56,1] element, prob = 0.0161133 (562,418)-(580,464) batch id : 0
[57,1] element, prob = 0.0161133 (570,2)-(612,70) batch id : 0
[58,1] element, prob = 0.0161133 (569,65)-(603,119) batch id : 0
[59,1] element, prob = 0.0161133 (571,85)-(603,152) batch id : 0
[60,1] element, prob = 0.0161133 (589,89)-(617,161) batch id : 0
[61,1] element, prob = 0.0161133 (599,95)-(629,157) batch id : 0
[62,1] element, prob = 0.0161133 (530,115)-(577,189) batch id : 0
[63,1] element, prob = 0.0161133 (596,123)-(629,194) batch id : 0
[64,1] element, prob = 0.0161133 (603,197)-(633,264) batch id : 0
[65,1] element, prob = 0.0161133 (584,245)-(614,322) batch id : 0
[66,1] element, prob = 0.0161133 (544,424)-(574,499) batch id : 0
[67,1] element, prob = 0.0161133 (544,453)-(594,561) batch id : 0
[68,1] element, prob = 0.0161133 (534,113)-(590,260) batch id : 0
[69,1] element, prob = 0.0161133 (557,95)-(635,269) batch id : 0
[70,1] element, prob = 0.0161133 (495,171)-(566,310) batch id : 0
[71,1] element, prob = 0.0161133 (475,138)-(583,347) batch id : 0
[72,1] element, prob = 0.0161133 (553,422)-(717,699) batch id : 0
[73,1] element, prob = 0.015625 (546,50)-(565,82) batch id : 0
[74,1] element, prob = 0.015625 (542,120)-(570,175) batch id : 0
[75,1] element, prob = 0.015625 (546,129)-(566,164) batch id : 0
[76,1] element, prob = 0.015625 (576,173)-(601,226) batch id : 0
[77,1] element, prob = 0.015625 (592,178)-(613,214) batch id : 0
[78,1] element, prob = 0.015625 (592,238)-(611,271) batch id : 0
[79,1] element, prob = 0.015625 (562,364)-(579,405) batch id : 0
[80,1] element, prob = 0.015625 (562,391)-(579,434) batch id : 0
[81,1] element, prob = 0.015625 (532,446)-(551,486) batch id : 0
[82,1] element, prob = 0.015625 (547,444)-(566,486) batch id : 0
[83,1] element, prob = 0.015625 (560,442)-(579,489) batch id : 0
[84,1] element, prob = 0.015625 (389,0)-(448,42) batch id : 0
[85,1] element, prob = 0.015625 (461,1)-(528,71) batch id : 0
[86,1] element, prob = 0.015625 (546,20)-(599,107) batch id : 0
[87,1] element, prob = 0.015625 (618,56)-(645,116) batch id : 0
[88,1] element, prob = 0.015625 (550,133)-(585,219) batch id : 0
[89,1] element, prob = 0.015625 (572,157)-(611,240) batch id : 0
[90,1] element, prob = 0.015625 (618,244)-(642,321) batch id : 0
[91,1] element, prob = 0.015625 (581,277)-(612,354) batch id : 0
[92,1] element, prob = 0.015625 (561,339)-(601,416) batch id : 0
[93,1] element, prob = 0.015625 (563,389)-(606,495) batch id : 0
[94,1] element, prob = 0.015625 (530,425)-(563,500) batch id : 0
[95,1] element, prob = 0.015625 (198,570)-(317,645) batch id : 0
[96,1] element, prob = 0.015625 (258,568)-(382,642) batch id : 0
[97,1] element, prob = 0.015625 (596,63)-(688,470) batch id : 0
[98,1] element, prob = 0.015625 (524,240)-(636,507) batch id : 0
[99,1] element, prob = 0.0146484 (467,0)-(490,29) batch id : 0
[100,1] element, prob = 0.0146484 (575,-1)-(610,37) batch id : 0
[101,1] element, prob = 0.0146484 (530,51)-(551,86) batch id : 0
[102,1] element, prob = 0.0146484 (360,70)-(387,116) batch id : 0
[103,1] element, prob = 0.0146484 (561,154)-(581,193) batch id : 0
[104,1] element, prob = 0.0146484 (578,152)-(598,192) batch id : 0
[105,1] element, prob = 0.0146484 (592,156)-(613,194) batch id : 0
[106,1] element, prob = 0.0146484 (561,182)-(580,218) batch id : 0
[107,1] element, prob = 0.0146484 (606,175)-(625,215) batch id : 0
[108,1] element, prob = 0.0146484 (590,202)-(614,253) batch id : 0
[109,1] element, prob = 0.0146484 (608,211)-(627,249) batch id : 0
[110,1] element, prob = 0.0146484 (622,212)-(639,250) batch id : 0
[111,1] element, prob = 0.0146484 (577,236)-(597,271) batch id : 0
[112,1] element, prob = 0.0146484 (621,231)-(639,266) batch id : 0
[113,1] element, prob = 0.0146484 (574,259)-(600,309) batch id : 0
[114,1] element, prob = 0.0146484 (573,351)-(595,409) batch id : 0
[115,1] element, prob = 0.0146484 (547,422)-(565,464) batch id : 0
[116,1] element, prob = 0.0146484 (408,0)-(482,81) batch id : 0
[117,1] element, prob = 0.0146484 (443,9)-(487,79) batch id : 0
[118,1] element, prob = 0.0146484 (537,57)-(570,127) batch id : 0
[119,1] element, prob = 0.0146484 (519,105)-(558,195) batch id : 0
[120,1] element, prob = 0.0146484 (506,158)-(543,239) batch id : 0
[121,1] element, prob = 0.0146484 (545,167)-(593,233) batch id : 0
[122,1] element, prob = 0.0146484 (565,220)-(605,294) batch id : 0
[123,1] element, prob = 0.0146484 (562,253)-(608,320) batch id : 0
[124,1] element, prob = 0.0146484 (562,290)-(603,374) 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

输入图像:

输出图像:

查看树莓派有哪些设备支持 OpenVINO

pi@raspberrypi:~/Desktop $ source /opt/intel/openvino_2021/bin/setupvars.sh
[setupvars.sh] OpenVINO environment initialized
pi@raspberrypi:~/Desktop $ python3
Python 3.7.3 (default, Jan 22 2021, 20:04:44)
[GCC 8.3.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
>>> from openvino.inference_engine import IECore
>>> ie = IECore()
>>> print(ie.available_devices)
[‘MYRIAD’]

注:
MYRIAD为神经计算棒插入树莓派后显示的设备名称。
如果插入的对象为Windows 10电脑则显示:[‘CPU’, ‘GNA’, ‘GPU’, ‘MYRIAD’]

踩坑:

  1. 我在检测图像时,找不到 object_detection_sample_ssd 这个文件:

pi@raspberrypi:~/build $ ./armv7l/Release/object_detection_sample_ssd -m ./open_model_zoo/tools/downloader/intel/face-detection-adas-0001/FP32/face-detection-adas-0001.xml -d MYRIAD -i ./test.jpg
./armv7l/Release/object_detection_sample_ssd: error while loading shared libraries: libinference_engine_transformations.so: cannot open shared object file: No such file or directory

  1. 在引入 openvino.inference_engine 库找不到 openvino

pi@raspberrypi:~/Desktop $ python3
Python 3.7.3 (default, Jan 22 2021, 20:04:44)
[GCC 8.3.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
>>> from openvino.inference_engine import IECore
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘openvino’

添加环境变可以解决以上问题

source /opt/intel/openvino_2021/bin/setupvars.sh

Raspberry Pi 4B安装 OpenVINO™ 工具包相关推荐

  1. 树莓派raspberry pi 4b 安装windows10(含网盘镜像)

    树莓派raspberry pi 4b 安装windows10 工作需要我网上开始寻找如何在树莓派4b上面安装windows,内网一言难尽,,最靠谱的就是下面这个 https://www.ithome. ...

  2. Raspberry Pi 4B 安装 PyTorch

    组件: Raspberry Pi 4B 2G 环境: Linux raspbian:5.4.83 指令集:aarch64 Miniconda:4.9.2 Python:3.7.10 Torch:1.7 ...

  3. 树莓派Raspberry Pi 4B安装Pytorch1.6+torchvision0.8

    树莓派pytorch搭建过程 前言 一.环境配置 二.搭建步骤 1.python准备 2.安装包准备 3.实际安装过程 4.其他花里胡哨操作 三.跑个模型试试水 总结 前言 生命不息,折腾不止! 号称 ...

  4. 树莓派raspberry Pi 4B安装Ubuntu 20.04 LTS系统后如何连接WiFi

    项目过程中,要求树莓派安装Ubuntu系统,并且可以连接WiFi.在网上看了很多方法,测试过几种方法之后,发现只有通过第三种方法才能顺利连接WiFi,现在将自己的尝试过程和最终的解决方法做一个记录. ...

  5. Raspberry Pi 4B 部署 YOLOX

    环境 Python:3.7.3 YOLOX:0.1.1rc0 torch:1.8.0 torchvision:0.9.0 OpenVINO:2021.4.582 g++ (Raspbian 8.3.0 ...

  6. Raspberry Pi 3B 安装Miniconda

    Raspberry Pi 4B 安装 Miniconda 查看内存信息 查看系统信息 查看树莓派的Linux版本 下载 miniconda 安装 Miniconda3 更新配置文件 查看安装的 con ...

  7. 搭建以太坊私有链(PoA)--CentOS7.6 on 阿里云ECS、macOS Catalina on Mac、Ubuntu20.04 on Raspberry Pi 4B

    使用Geth搭建以太坊PoA私有链 搭建以太坊私有链(PoA) 1 阿里云ECS上的操作步骤 1.1 准备环境 1.2 安装Geth及Tools 1.3 创建以太坊私有链的数据文件夹 1.4 用pup ...

  8. Raspberry Pi 4B 开机自动运行Python文件

    组件: Raspberry Pi 4B 环境: Python 3.7.3 1.写自启动脚本 我先在Desktop下创建一个shell脚本 创建格式: sudo nano XXX.sh 我的脚本: su ...

  9. 树莓派>Raspberry Pi 4b OLED显示

    Raspberry Pi 树莓派>Raspberry Pi 4b OLED显示 硬件设备 接线 开启树莓派I2c 安装i2c通信工具和python3 驱动oled显示 **方案1 采用 luma ...

最新文章

  1. 滴滴联合比亚迪:首款定制网约车D1发布
  2. python 批量下载 代码_Python + Selenium +Chrome 批量下载网页代码修改
  3. summerDao-比mybatis更强大无需映射配置的dao工具
  4. 案例:对比使用Java代码与EL表达式获取信息
  5. 网上讨论“电商平台打败了实体店”?
  6. Java 实验5 T4 检验字符串是否合法
  7. beetle.express一通讯案例测试结果
  8. java Spring菜鸟教程,只需一篇文章吃透Java多线程技术
  9. java messagedigest_JAVA MessageDigest(MD5加密等)
  10. 网页设计中文标题h1~h4应用技巧
  11. 数据库的三级封锁协议
  12. 经典算法问题-01-八皇后
  13. 个人所得税 java_计算个人所得税的java代码
  14. 通过云片网实现短信以及验证码的发送
  15. 搭建STC89C51工程模板
  16. simplex法(单纯形) 并在python实现简单的应用
  17. 免费短信验证码SDK是一款由移动开发服务平台Mob(前身ShareSDK)正式推出“全球短信验证码解决方案”
  18. 【解决方案】RTSP协议视频平台EasyNVR建立智能水库管理系统,打造智慧水库
  19. 养儿子是建设银行,女儿是招商银行
  20. 单线程读单线程写一个变量是否一定要加锁

热门文章

  1. 2016-2017 ACM-ICPC Pacific Northwest Regional Contest (Div. 2) 【部分题解】
  2. tinyhttpd-0.1.0_hacking
  3. 选择select 标签中指定值的option
  4. linux命令使用全集
  5. 网页如何调用flash的方法
  6. django模板导入js,css等外部文件
  7. 实现DFS之“农田灌溉”
  8. STL之七:STL各种容器的使用时机详解
  9. golang中的strings.ToTitle
  10. 如何不能保证每次都请求成功