私的AI研究会 > NCAppZoo1
Neural Compute Application ZooというGitHubにて公開されているサイトから Neural Compute Stick 2 とRaspberryPi でディープラーニングの推論アプリケーションを実習する。(その1)
pi@raspberrypi:~ $ git clone https://github.com/movidius/ncappzoo.git Cloning into 'ncappzoo'... remote: Enumerating objects: 2, done. remote: Counting objects: 100% (2/2), done. remote: Compressing objects: 100% (2/2), done. remote: Total 7160 (delta 0), reused 0 (delta 0), pack-reused 7158 Receiving objects: 100% (7160/7160), 576.59 MiB | 2.08 MiB/s, done. Resolving deltas: 100% (4456/4456), done.ディレクトリ「ncappzoo」が作成される。
pi@raspberrypi-mas:~ $ ls Bookshelf Documents Music Public Videos cq work-opencv Desktop Downloads Pictures Templates build ncappzoo workspace
pi@raspberrypi:~ $ git clone https://github.com/opencv/dldt.git Cloning into 'dldt'... remote: Enumerating objects: 99045, done. remote: Total 99045 (delta 0), reused 0 (delta 0), pack-reused 99045 Receiving objects: 100% (99045/99045), 111.09 MiB | 1.60 MiB/s, done. Resolving deltas: 100% (71833/71833), done. Checking out files: 100% (10335/10335), done. pi@raspberrypi:~ $ cd dldt/model-optimizer pi@raspberrypi:~/dldt/model-optimizer $ ls CMakeLists.txt install_prerequisites mo_kaldi.py requirements.txt requirements_mxnet.txt setup.py README.md mo mo_mxnet.py requirements_caffe.txt requirements_onnx.txt telemetry automation mo.py mo_onnx.py requirements_dev.txt requirements_tf.txt extensions mo_caffe.py mo_tf.py requirements_kaldi.txt requirements_tf2.txt pi@raspberrypi:~/dldt/model-optimizer $ pip3 install -r requirements_tf.txt Ignoring tensorflow: markers 'python_version >= "3.8"' don't match your environment Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting tensorflow<2.0,>=1.15.2 (from -r requirements_tf.txt (line 1)) Could not find a version that satisfies the requirement tensorflow<2.0,>=1.15.2 (from -r requirements_tf.txt (line 1)) (from versions: 0.11.0, 1.12.0, 1.13.1, 1.14.0) No matching distribution found for tensorflow<2.0,>=1.15.2 (from -r requirements_tf.txt (line 1)) pi@raspberrypi:~/dldt/model-optimizer $ pip3 install -r requirements_caffe.txt Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting networkx>=1.11 (from -r requirements_caffe.txt (line 1)) Downloading https://files.pythonhosted.org/packages/9b/cd/dc52755d30ba41c60243235460961fc28022e5b6731f16c268667625baea/networkx-2.5-py3-none-any.whl (1.6MB) 100% |████████████████████████████████| 1.6MB 273kB/s Requirement already satisfied: numpy>=1.14.0 in /usr/lib/python3/dist-packages (from -r requirements_caffe.txt (line 2)) (1.16.2) Collecting protobuf>=3.6.1 (from -r requirements_caffe.txt (line 3)) Downloading https://files.pythonhosted.org/packages/81/d4/a8a31a326ee60e295e5d7477d93d8f6ceee98246c1a7381afc817a91d893/protobuf-3.14.0-py2.py3-none-any.whl (173kB) 100% |████████████████████████████████| 174kB 2.2MB/s Collecting test-generator==0.1.1 (from -r requirements_caffe.txt (line 4)) Downloading https://files.pythonhosted.org/packages/4a/52/e5eec4d926eb466844eaeeaac84af5372e946dd520fb2b6adf3388e620b0/test_generator-0.1.1-py2.py3-none-any.whl Collecting defusedxml>=0.5.0 (from -r requirements_caffe.txt (line 5)) Downloading https://files.pythonhosted.org/packages/06/74/9b387472866358ebc08732de3da6dc48e44b0aacd2ddaa5cb85ab7e986a2/defusedxml-0.6.0-py2.py3-none-any.whl Requirement already satisfied: requests>=2.20.0 in /usr/lib/python3/dist-packages (from -r requirements_caffe.txt (line 6)) (2.21.0) Requirement already satisfied: decorator>=4.3.0 in /usr/lib/python3/dist-packages (from networkx>=1.11->-r requirements_caffe.txt (line 1)) (4.3.0) Requirement already satisfied: six>=1.9 in /usr/lib/python3/dist-packages (from protobuf>=3.6.1->-r requirements_caffe.txt (line 3)) (1.12.0) Installing collected packages: networkx, protobuf, test-generator, defusedxml Successfully installed defusedxml-0.6.0 networkx-2.5 protobuf-3.14.0 test-generator-0.1.1 pi@raspberrypi:~/dldt/model-optimizer $ export PATH=~/dldt/model-optimizer:$PATH pi@raspberrypi:~/dldt/model-optimizer $ export PYTHONPATH=~/dldt/model-optmizer:$PYTHONPATH
pi@raspberrypi:~ $ cd ~/ncappzoo pi@raspberrypi-mas:~/ncappzoo $ ls CONTRIBUTING.md MAKEFILE_GUIDANCE.md OWNERS apps data install_deps.sh omz tensorflow LICENSE Makefile README.md caffe docs networks shared pi@raspberrypi:~/ncappzoo $ ./install_deps.sh Checking system dependencies...\n Intel Distribution of OpenVINO is installed. Python3, pip3, git, and essential compilers are installed. networkx 2.5 Minimal Python packages installed ncappzoo is ready.環境はできたようだ。↑
pi@raspberrypi:~/ncappzoo/apps $ pip3 install pyyaml --user Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting pyyaml Downloading https://files.pythonhosted.org/packages/a0/a4/d63f2d7597e1a4b55aa3b4d6c5b029991d3b824b5bd331af8d4ab1ed687d/PyYAML-5.4.1.tar.gz (175kB) 100% |████████████████████████████████| 184kB 614kB/s Installing build dependencies ... done Building wheels for collected packages: pyyaml Running setup.py bdist_wheel for pyyaml ... done Stored in directory: /home/pi/.cache/pip/wheels/2a/d4/92/cf299bdf4162957ca8126b46e913e29f76a4f17ca762c45028 Successfully built pyyaml Installing collected packages: pyyaml Successfully installed pyyaml-5.4.1
[setupvars.sh] OpenVINO environment initialized mizutu@ubuntu2004dk:~$ git clone https://github.com/movidius/ncappzoo.git Cloning into 'ncappzoo'... remote: Enumerating objects: 2, done. remote: Counting objects: 100% (2/2), done. remote: Compressing objects: 100% (2/2), done. remote: Total 7160 (delta 0), reused 0 (delta 0), pack-reused 7158 Receiving objects: 100% (7160/7160), 576.59 MiB | 13.63 MiB/s, done. Resolving deltas: 100% (4456/4456), done.ディレクトリ「ncappzoo」が作成される。
mizutu@ubuntu2004dk:~$ ls inference_engine_demos_build openvino2.txt work ビデオ inference_engine_samples_build openvino3.txt ダウンロード ピクチャ linux-vm-tools openvino4.txt テンプレート ミュージック ncappzoo openvino_models デスクトップ 公開 openvino.txt shared-drives ドキュメント
mizutu@ubuntu2004dk:~$ cd ~/ncappzoo mizutu@ubuntu2004dk:~/ncappzoo$ ls CONTRIBUTING.md Makefile apps docs omz LICENSE OWNERS caffe install_deps.sh shared MAKEFILE_GUIDANCE.md README.md data networks tensorflow mizutu@ubuntu2004dk:~/ncappzoo$ ./install_deps.sh Checking system dependencies...\n Intel Distribution of OpenVINO is installed. Python3, pip3, git, and essential compilers are installed. networkx 2.5 tensorflow 2.3.2 tensorflow-estimator 2.3.0 Minimal Python packages installed ncappzoo is ready.こちらの方が簡単。↑
mizutu@ubuntu2004dk:~/ncappzoo$ pip3 install pyyaml --user Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (5.3.1)
dir 1 | dir 2 | make | run | note |
apps | benchmark_ncs | ○ | ○ | - |
birds | ○ | ○ | - | |
chef_ai | ○ | × | - | |
classifier_flash | ○ | ○ | - | |
classifier_grid | ○ | ○ | - | |
classifier_gui | ○ | × | scikit-image バージョン不整合 | |
driving_pi | × | × | 要ハードウェア | |
gender_age | ○ | × | cpp | |
gesture_piarm | ? | ? | - | |
mnist_calc | ○ | ○ | - | |
ncs_digital_sign | ? | ? | cpp | |
realsense_object_distance_detection | ? | ? | cpp | |
realsense_segmentation | ? | ? | cpp | |
simple_classifier_cpp | ? | ? | cpp | |
simple_classifier_cpp_camera | ? | ? | cpp | |
simple_classifier_py | ○ | ○ | - | |
simple_classifier_py_camera | ○ | ○ | - |
dir 1 | dir 2 | make | run | note |
networks | age_gender_net | ○ | ※ | - |
alexnet | ○ | - | データのみ | |
emotions_recognition_retail_0003 | ○ | ○ | - | |
face_detection_retail_0004 | ○ | ○ | - | |
facenet | ○ | ○ | - | |
googlenet_v1 | ○ | ? | データのみ | |
inception_v1 | × | × | - | |
inception_v2 | × | × | - | |
inception_v3 | × | × | - | |
inception_v4 | × | × | - | |
mnist | ○ | ○ | - | |
mobilenets | × | × | - | |
resnet_50 | × | × | - | |
semantic_segmentation_adas_0001 | ○ | × | cpp | |
squeezenet_v1.0 | ○ | - | データのみ | |
ssd_inception_v2_food | ○ | ※ | - | |
ssd_inception_v2_gesture | ○ | ※ | - | |
ssd_mobilenet_v1_caffe | ○ | ○ | - | |
tf_models | ○ | - | データのみ | |
tf_src | ○ | - | データのみ | |
tiny_yolo_v1 | ○ | ○ | - | |
tiny_yolo_v2 | × | × | - | |
tiny_yolo_v3 | × | × | - |
├── omz ├── shared │ ├── C++ │ └── Python ├── data │ ├── digit_images │ ├── ilsvrc12 │ └── images ├── docs │ ├── apps │ ├── assets │ ├── images │ └── networks ├── caffe → networks に移行 └── tensorflow → networks に移行