LoginSignup
0
1

More than 3 years have passed since last update.

Run OpenVINO-2021.1, OpenCV-4.5.1-pre on M1 MacBook Air with Intel Neural Compute Stick 2 (homebrew)

Last updated at Posted at 2020-12-06

Introduction

2020-12-06時点の記録。

この時点でhomebrewのpythonのApple Silicon(M1)対応は不完全で、numpy 等々をインストールできません。なので、C++ で動いています。pythonでやりたいならこちら

Work!! Intel Neural Compute Stick 2 (MYRIAD X) on Apple Silicon (M1) MacBook Air !!
MBA-NCS2.jpg

Environment

  • Intel Compute Stick 2 (NCS2)
  • MacBook Air 2020 (M1)
  • OpenVINO 2021.1 (No support CPU:arm)
  • OpenCV HEAD (tag 4.5.0-openvino fail)
  • Homebrew: cmake python cython wget automake autoconf libtool
  • MacPorts: libusb (Homebrew's libusb fail)

build OpenVINO 2021.1

source tree

NOTE: Don't work Homebrew's git-lfs yet. (2020-12-06)

download openvino-2021.zip from https://github.com/openvinotoolkit/openvino

unzip -x openvino-2021.zip
cd openvino-2021

git clone https://github.com/opencv/ade.git inference-engine/thirdparty/ade
git clone https://github.com/openvinotoolkit/oneDNN.git inference-engine/thirdparty/mkl-dnn
git clone https://github.com/openvinotoolkit/googletest.git inference-engine/tests/ie_test_utils/common_test_utils/gtest
git clone https://github.com/gflags/gflags.git inference-engine/samples/thirdparty/gflags

build

mkdir openvino-2021/build
cd openvino-2021/build

cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DENABLE_PYTHON=ON \
    -DPYTHON_EXECUTABLE=/opt/homebrew/bin/python3.9 \
    -DPYTHON_LIBRARY=/opt/homebrew/Cellar/python@3.9/3.9.0_4/Frameworks/Python.framework/Versions/3.9/lib/libpython3.9.dylib \
    -DPYTHON_INCLUDE_DIR=/opt/homebrew/Cellar/python@3.9/3.9.0_4/Frameworks/Python.framework/Versions/3.9/include/python3.9 \
    ..

make -j 8
sudo make install

build OpenCV

source tree

git clone --depth 1 https://github.com/opencv/opencv.git opencv-master

build

mkdir opencv-master/build
cd opencv-master/build

cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DWITH_INF_ENGINE=ON \
    -DENABLE_CXX11=ON \
    -DENABLE_PYTHON=ON \
    -DPYTHON_EXECUTABLE=/opt/homebrew/bin/python3.9 \
    -DPYTHON_LIBRARY=/opt/homebrew/Cellar/python@3.9/3.9.0_4/Frameworks/Python.framework/Versions/3.9/lib/libpython3.9.dylib \
    -DPYTHON_INCLUDE_DIR=/opt/homebrew/Cellar/python@3.9/3.9.0_4/Frameworks/Python.framework/Versions/3.9/include/python3.9 \
    ..

make -j 8
sudo make install

Run with Intel Neural Compurte Stick 2

hello_query_device.png

Reference

Note

homebrew: don’t support yet: numpy, git-lfs (2020-12-06)
気がついたことがあれば教えてください。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1