Run OpenVINO-2021.2, OpenCV-4.5.1-openvino on M1 MacBook Air with Intel Neural Compute Stick 2 (conda-forge/Miniforge)
4171 단어 OpenCVOpenVINOAppleSiliconncs2M1
Introduction
2020-12-19 시점 기록.
conda-forge/Miniforge에서는 Apple Silicon(M1) 대응(osx-arm64)이 앞서 있습니다.
numpy, scipy, matplotlib 등이 지원됩니다.
Work!! Intel Neural Compute Stick 2 (MYRIAD X) on Apple Silicon (M1) MacBook Air !!
환경
Miniforge3 : cython
build OpenVINO 2021.2
소스 트리
NOTE: Don't work MacPorts's(Homebrew's) git-lfs yet. (2020-12-19)
Download git-lfs from htps : // 기 tlfs. 기주 b. 코m/
cp/usr/local/bin/git-lfs (x86_64)
git clone -b 2021.2 https://github.com/openvinotoolkit/openvino.git openvino-2021.2
cd openvino-2021.2
git submodule update --init --recursive
build
Install dir/opt/arm64/openvino. Same as OpenVINO Distribution.
(/usr/local로 여러가지 섞는 것이 싫고, Intel Ubuntu에서는 apt로 넣기 때문에 장소를 가지런히 하고 싶기 때문에)
mkdir openvino-2021.2/build
cd openvino-2021.2/build
cmake \
-DCMAKE_INSTALL_PREFIX=/opt/arm64/openvino_2021.2 \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_PYTHON=ON \
-DPYTHON_EXECUTABLE=$HOME/miniforge3/bin/python3.9 \
-DPYTHON_LIBRARY=$HOME/miniforge3/lib/libpython3.9.dylib \
-DPYTHON_INCLUDE_DIR=$HOME/miniforge3/include/python3.9 \
..
make -j 8
sudo make install
sudo ln -s /opt/arm64/openvino_2021.2 /opt/arm64/openvino
if use zsh, patch it.
*** setupvars.sh.orig 2020-12-17 12:28:59.000000000 +0900
--- setupvars.sh 2020-12-17 12:29:34.000000000 +0900
***************
*** 18,23 ****
--- 18,24 ----
BASE_DIR="$( dirname "$SCRIPT_DIR" )"
INSTALLDIR="${BASE_DIR}"
+ INSTALLDIR=/usr/local
environment valiable
source /opt/arm64/openvino/bin/setupvars.sh
export ngraph_DIR=/opt/arm64/openvino/cmake
export OpenCV_DIR=/opt/arm64/openvino/opencv
export PYTHONPATH=/opt/arm64/openvino/opencv/lib/python3.9/site-packages:$PYTHONPATH
export LD_LIBRARY_PATH=/opt/arm64/openvino/lib:$LD_LIBRARY_PATH
build OpenCV
소스 트리
git clone --depth 1 -b 4.5.1-openvino https://github.com/opencv/opencv.git opencv-4.5.1-openvino
build
Install dir/opt/arm64/openvino/opencv. Same as OpenVINO Distribution.
mkdir opencv-4.5.1-openvino/build
cd opencv-4.5.1-openvino/build
cmake \
-DCMAKE_INSTALL_PREFIX=/opt/arm64/openvino_2021.2/opencv \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_INF_ENGINE=ON \
-DENABLE_CXX11=ON \
-DWITH_TBB=ON \
-DENABLE_PYTHON=ON \
-DPYTHON3_EXECUTABLE=$HOME/miniforge3/bin/python3.9 \
-DPYTHON3_LIBRARY=$HOME/miniforge3/lib/libpython3.9.dylib \
-DPYTHON3_INCLUDE_DIR=$HOME/miniforge3/include/python3.9 \
..
make -j 8
sudo make install
Run with Intel Neural Compurte Stick 2
python opencv-4.5.1-openvino/samples/python/video_threaded.py
python /opt/arm64/openvino/deployment_tools/inference_engine/samples/python/classification_sample_async/classification_sample_async.py -m alexnet.xml -d MYRIAD -i image.jpg
Run Success!! 파이썬에서도 작동합니다.
Reference
git clone -b 2021.2 https://github.com/openvinotoolkit/openvino.git openvino-2021.2
cd openvino-2021.2
git submodule update --init --recursive
mkdir openvino-2021.2/build
cd openvino-2021.2/build
cmake \
-DCMAKE_INSTALL_PREFIX=/opt/arm64/openvino_2021.2 \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_PYTHON=ON \
-DPYTHON_EXECUTABLE=$HOME/miniforge3/bin/python3.9 \
-DPYTHON_LIBRARY=$HOME/miniforge3/lib/libpython3.9.dylib \
-DPYTHON_INCLUDE_DIR=$HOME/miniforge3/include/python3.9 \
..
make -j 8
sudo make install
sudo ln -s /opt/arm64/openvino_2021.2 /opt/arm64/openvino
*** setupvars.sh.orig 2020-12-17 12:28:59.000000000 +0900
--- setupvars.sh 2020-12-17 12:29:34.000000000 +0900
***************
*** 18,23 ****
--- 18,24 ----
BASE_DIR="$( dirname "$SCRIPT_DIR" )"
INSTALLDIR="${BASE_DIR}"
+ INSTALLDIR=/usr/local
source /opt/arm64/openvino/bin/setupvars.sh
export ngraph_DIR=/opt/arm64/openvino/cmake
export OpenCV_DIR=/opt/arm64/openvino/opencv
export PYTHONPATH=/opt/arm64/openvino/opencv/lib/python3.9/site-packages:$PYTHONPATH
export LD_LIBRARY_PATH=/opt/arm64/openvino/lib:$LD_LIBRARY_PATH
소스 트리
git clone --depth 1 -b 4.5.1-openvino https://github.com/opencv/opencv.git opencv-4.5.1-openvino
build
Install dir/opt/arm64/openvino/opencv. Same as OpenVINO Distribution.
mkdir opencv-4.5.1-openvino/build
cd opencv-4.5.1-openvino/build
cmake \
-DCMAKE_INSTALL_PREFIX=/opt/arm64/openvino_2021.2/opencv \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_INF_ENGINE=ON \
-DENABLE_CXX11=ON \
-DWITH_TBB=ON \
-DENABLE_PYTHON=ON \
-DPYTHON3_EXECUTABLE=$HOME/miniforge3/bin/python3.9 \
-DPYTHON3_LIBRARY=$HOME/miniforge3/lib/libpython3.9.dylib \
-DPYTHON3_INCLUDE_DIR=$HOME/miniforge3/include/python3.9 \
..
make -j 8
sudo make install
Run with Intel Neural Compurte Stick 2
python opencv-4.5.1-openvino/samples/python/video_threaded.py
python /opt/arm64/openvino/deployment_tools/inference_engine/samples/python/classification_sample_async/classification_sample_async.py -m alexnet.xml -d MYRIAD -i image.jpg
Run Success!! 파이썬에서도 작동합니다.
Reference
python opencv-4.5.1-openvino/samples/python/video_threaded.py
python /opt/arm64/openvino/deployment_tools/inference_engine/samples/python/classification_sample_async/classification_sample_async.py -m alexnet.xml -d MYRIAD -i image.jpg
Note
pytorch 가 빨리 Apple Silicon(M1) 대응되도록!
Reference
이 문제에 관하여(Run OpenVINO-2021.2, OpenCV-4.5.1-openvino on M1 MacBook Air with Intel Neural Compute Stick 2 (conda-forge/Miniforge)), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/kose3/items/171c9a3477303ec1bfdf
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
Reference
이 문제에 관하여(Run OpenVINO-2021.2, OpenCV-4.5.1-openvino on M1 MacBook Air with Intel Neural Compute Stick 2 (conda-forge/Miniforge)), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/kose3/items/171c9a3477303ec1bfdf텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)