Raspberry Pi學習筆記(二十八):在Pi 3B+上安裝OpenVINO環境(搭配第一代Intel® Movidius™ NCS運算棒)

在五月份的時候,曾經寫了一篇Raspberry Pi學習筆記(十三):使用 第一代Intel® Movidius™ NCS運算棒,當時所使用的是 NCSDK,不過目前NCSDK較少人使用,加上這兩天看到OpenVINO-YoloV3,能夠讓YOLOv3透過NCS運算棒在Pi上執行,因此決定來使用OpenVINO。

###原本以為OpenVINO只支援二代的NCS沒想到今天發現一代也支援。

參考官方教學

建立資料夾

mkdir openvino
cd openvino

下載並解壓縮VINO

wget https://download.01.org/opencv/2019/openvinotoolkit/R3/l_openvino_toolkit_runtime_raspbian_p_2019.3.334.tgzsudo mkdir -p /opt/intel/openvinosudo tar -xf l_openvino_toolkit_runtime_raspbian_p_2019.3.334.tgz --strip 1 -C /opt/intel/openvino

安裝CMake

sudo apt install cmake

設定環境變數

source /opt/intel/openvino/bin/setupvars.sh
echo "source /opt/intel/openvino/bin/setupvars.sh" >> ~/.bashrc
[setupvars.sh] OpenVINO environment initialized

新增USB規則

sudo usermod -a -G users "$(whoami)"source /opt/intel/openvino/bin/setupvars.shsh /opt/intel/openvino/install_dependencies/install_NCS_udev_rules.sh#插入運算棒

編譯並且執行範例

mkdir build && cd buildcmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=armv7-a" /opt/intel/openvino/deployment_tools/inference_engine/samplesmake -j2 object_detection_sample_ssd#下載訓練好的模型
wget --no-check-certificate https://download.01.org/opencv/2019/open_model_zoo/R1/models_bin/face-detection-adas-0001/FP16/face-detection-adas-0001.bin
wget --no-check-certificate https://download.01.org/opencv/2019/open_model_zoo/R1/models_bin/face-detection-adas-0001/FP16/face-detection-adas-0001.xml#執行範例測試<path to image記得自己放一張人臉圖片進來>
./armv7l/Release/object_detection_sample_ssd -m face-detection-adas-0001.xml -d MYRIAD -i <path_to_image>

Written by

Machine Learning / Deep Learning / Python / Flutter cakeresume.com/yanwei-liu

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store