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

Introduction



2020-12-06 시점의 기록.

이 시점에서 homebrew python의 Apple Silicon (M1) 지원은 불완전하며 numpy 등을 설치할 수 없습니다. 그래서 C++에서 움직이고 있습니다. 파이썬으로하고 싶다면 여기

Work!! Intel Neural Compute Stick 2 (MYRIAD X) on Apple Silicon (M1) MacBook Air !!


환경


  • 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



    소스 트리



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

    download openvino-2021.zip from htps : // 기주 b. 코 m / 오펜 ゔ ㅇ ㅇ t / 오 ゔ ぃ
    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/[email protected]/3.9.0_4/Frameworks/Python.framework/Versions/3.9/lib/libpython3.9.dylib \
        -DPYTHON_INCLUDE_DIR=/opt/homebrew/Cellar/[email protected]/3.9.0_4/Frameworks/Python.framework/Versions/3.9/include/python3.9 \
        ..
    
    make -j 8
    sudo make install
    

    build OpenCV



    소스 트리


    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/[email protected]/3.9.0_4/Frameworks/Python.framework/Versions/3.9/lib/libpython3.9.dylib \
        -DPYTHON_INCLUDE_DIR=/opt/homebrew/Cellar/[email protected]/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





    Reference


  • OpenVINO wiki: BuildingForMacOS

  • Note



    homebrew: don’t support yet: numpy, git-lfs (2020-12-06)
    눈치챘다면 알려주세요.

    좋은 웹페이지 즐겨찾기