0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

『Gigapixel AI』を使うための「OpenVINOツールキット」のインストール

Last updated at Posted at 2022-04-28

『Gigapixel AI』を使うのに「Intel OpenVINOツールキット」がいるらしいのですけどインストールが結構難しかったので覚え書き。

基本的な流れはこちら

OpenVINO環境構築(MacOS編)
https://openvino.jp/configuration-macos/

ところどころぼくの環境と違ったのでそこらへんと参考リンクをメモ書き。
 

CMakeのインストール

1. Homebrewをインストール

ターミナル
 ~ % /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

 

2. Homebrewで、CMakeをインストール

C++初心者がMacでCMakeを利用してみる - Qiita
https://qiita.com/kai_kou/items/df335eb7ee78229ee46f

よくわかんなかったのでHomebrewでインストールした

ターミナル
 ~ % brew install cmake

 

3. ターミナル「cmake --version」を実行してパスが正しく通っているか確認

OpenCVのセットアップ方法 (macOSアプリ用) | アールケー開発
https://www.rk-k.com/archives/3907#CMake

ターミナル
 ~ % cmake --version

 

Pythonのインストール

4. Pythonをダウンロード・インストール

https://www.python.org/downloads/
(OpenVINOに付いてくるっぽいんでいらんかったかも)
 

Xcode Command Line Toolsのインストール

5. Xcode Command Line Tools をダウンロード・インストール

https://developer.apple.com/download/all/?q=Xcode
(OSに合うバージョンをがんばって探す)
 

OpenVINO ツールキットのインストール

6. OpenVINO Toolkit(Dev Tools)をダウンロード・インストール

https://www.intel.com/content/www/us/en/developer/tools/openvino-toolkit/download.html
(CMakeのインストールが上手くいってないとエラーが出る)
 

OpenVINOの環境変数を設定する

大まかな流れはこちら

Install Intel® Distribution of OpenVINO™ toolkit for macOS
https://docs.openvino.ai/2020.2/_docs_install_guides_installing_openvino_macos.html#set-the-environment-variables
 

7. Finder>移動>フォルダに移動 で、「/opt/intel/」に移動する

8. フォルダ名が「openvino_YYYY.X.XXX」になっていたら、コピーして「openvino」に変更する

9. ターミナル「source /opt/intel/openvino/bin/setupvars.sh」でOpenVINO初期化

ターミナル
 ~ % source /opt/intel/openvino/bin/setupvars.sh

 

10. 自分のMacのデフォルトシェルがzshか?bash?か確認する

あなたのmacはzsh? それともbash?
https://amateur-engineer.com/mac-path-zsh/

ターミナル
 ~ % echo $SHELL

 

11. ターミナル「open ~/.zshrc」もしくは「open ~/.bash_profile」でファイルを開く

ターミナル
 ~ % open ~/.zshrc

 

12. 開いたファイルの最終行に「source /opt/intel/openvino/bin/setupvars.sh」を追加して保存

.zshrc
 ~ % source /opt/intel/openvino/bin/setupvars.sh

 

13. ターミナル再起動で「[setupvars.sh] OpenVINO environment initialized」が表示されてればOK

ターミナル再起動
[setupvars.sh] OpenVINO environment initialized

 

Model Optimizer の設定

14. ターミナル「cd /opt/intel/openvino/deployment_tools/model_optimizer/install_prerequisites」で移動 → 「sudo ./install_prerequisites.sh」 で設定?

ターミナル
 ~ % cd /opt/intel/openvino/deployment_tools/model_optimizer/install_prerequisites
ターミナル
 ~ % sudo ./install_prerequisites.sh

 

検証スクリプトを実行して、インストールを検証する

15. 画像分類検証スクリプトを実行する

ターミナル「cd /opt/intel/openvino/deployment_tools/demo」 で移動 → ターミナル「./demo_squeezenet_download_convert_run.sh」 で実行

ターミナル
 ~ % cd /opt/intel/openvino/deployment_tools/demo
ターミナル
 ~ % ./demo_squeezenet_download_convert_run.sh

 

16. 推論パイプライン検証スクリプトを実行する

15のまま、ターミナル「./demo_security_barrier_camera.sh」で実行>処理後「Detection results」の画像が出てきたら、たぶんOpenVINOのインストール成功

ターミナル
 ~ % ./demo_security_barrier_camera.sh

Detection resultsスクリーンショット 2022-04-27 1.20.14.jpg
 

NeuralComputeStick2 の使用

17. ターミナル「brew install libusb」で、一応「libusb」をインストール

ターミナル
 ~ % brew install libusb

以上です。

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?