私的AI研究会 > NCAppZoo2
Neural Compute Application ZooというGitHubにて公開されているサイトから Neural Compute Stick 2 とRaspberryPi でディープラーニングの推論アプリケーションを実習する。(その2)
参照 → https://github.com/movidius/ncappzoo/blob/master/apps/README.md
mizutu@ubuntu2004dk:~/ncappzoo/apps$ cd birds mizutu@ubuntu2004dk:~/ncappzoo/apps/birds$ ls AUTHORS README.md googlenet_processor.py screen_shot.jpg Makefile birds.py labels.txt tiny_yolo_processor.py mizutu@ubuntu2004dk:~/ncappzoo/apps/birds$ make birds: Downloading images... mkdir -p ./images; wget -c --no-cache -P ./images https://www.nps.gov/sajh/learn/nature/images/Eagles-2_Rebecca.jpg; wget -c --no-cache -P ./images https://raw.githubusercontent.com/nealvis/bird_images/master/jas_birds_10.jpg; wget -c --no-cache -P ./images https://raw.githubusercontent.com/nealvis/bird_images/master/jas_birds_2.jpg; wget -c --no-cache -P ./images https://raw.githubusercontent.com/nealvis/bird_images/master/jas_birds_8.jpg; wget -c --no-cache -P ./images https://raw.githubusercontent.com/nealvis/bird_images/master/nps_birds_1.jpg; wget -c --no-cache -P ./images https://raw.githubusercontent.com/nealvis/bird_images/master/nps_birds_2.jpg; wget -c --no-cache -P ./images https://raw.githubusercontent.com/nealvis/bird_images/master/nps_birds_3.jpg; --2021-02-19 10:38:11-- https://www.nps.gov/sajh/learn/nature/images/Eagles-2_Rebecca.jpg www.nps.gov (www.nps.gov) をDNSに問いあわせています... 23.41.80.215, 2600:140b:8800:18d::20ce, 2600:140b:8800:191::20ce : : `./tiny_yolo_v1_caffe.zip' に保存中 tiny_yolo_v1_caffe. 100%[===================>] 95.75M 10.1MB/s in 10s 2021-02-19 10:38:26 (9.16 MB/s) - `./tiny_yolo_v1_caffe.zip' へ保存完了 [100399378/100399378] Archive: tiny_yolo_v1_caffe.zip inflating: MODEL_UNZIPPED/tiny-yolo-v1.prototxt inflating: MODEL_UNZIPPED/tiny-yolo-v1_53000.caffemodel tiny_yolo_v1: Compiling model to IR... Intel OpenVINO environment is already set! /opt/intel/openvino_2021.2.185/deployment_tools/model_optimizer/mo/main.py:85: SyntaxWarning: "is" with a literal. Did you mean "=="? if op is 'k': Model Optimizer arguments: Common parameters: - Path to the Input Model: /home/mizutu/ncappzoo/networks/tiny_yolo_v1/MODEL_UNZIPPED/tiny-yolo-v1_53000.caffemodel - Path for generated IR: /home/mizutu/ncappzoo/networks/tiny_yolo_v1/. - IR output name: tiny-yolo-v1_53000 - Log level: ERROR - Batch: Not specified, inherited from the model - Input layers: Not specified, inherited from the model - Output layers: Not specified, inherited from the model - Input shapes: Not specified, inherited from the model - Mean values: Not specified - Scale values: [255] - Scale factor: Not specified - Precision of IR: FP16 - Enable fusing: True - Enable grouped convolutions fusing: True - Move mean values to preprocess section: None - Reverse input channels: True Caffe specific parameters: - Path to Python Caffe* parser generated from caffe.proto: /opt/intel/openvino_2021/deployment_tools/model_optimizer/mo/front/caffe/proto - Enable resnet optimization: True - Path to the Input prototxt: /home/mizutu/ncappzoo/networks/tiny_yolo_v1/MODEL_UNZIPPED/tiny-yolo-v1.prototxt - Path to CustomLayersMapping.xml: Default - Path to a mean file: Not specified - Offsets for a mean file: Not specified Model Optimizer version: 2021.2.0-1877-176bdf51370-releases/2021/2 2021-02-19 10:38:27.613202: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcudart.so.10.1'; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /opt/intel/openvino_2021/data_processing/dl_streamer/lib:/opt/intel/openvino_2021/data_processing/gstreamer/lib:/opt/intel/openvino_2021/opencv/lib:/opt/intel/openvino_2021/deployment_tools/ngraph/lib:/opt/intel/openvino_2021/deployment_tools/inference_engine/external/hddl/lib:/opt/intel/openvino_2021/deployment_tools/inference_engine/external/gna/lib:/opt/intel/openvino_2021/deployment_tools/inference_engine/external/mkltiny_lnx/lib:/opt/intel/openvino_2021/deployment_tools/inference_engine/external/tbb/lib:/opt/intel/openvino_2021/deployment_tools/inference_engine/lib/intel64 2021-02-19 10:38:27.613260: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. [ SUCCESS ] Generated IR version 10 model. [ SUCCESS ] XML file: /home/mizutu/ncappzoo/networks/tiny_yolo_v1/./tiny-yolo-v1_53000.xml [ SUCCESS ] BIN file: /home/mizutu/ncappzoo/networks/tiny_yolo_v1/./tiny-yolo-v1_53000.bin [ SUCCESS ] Total execution time: 6.75 seconds. [ SUCCESS ] Memory consumed: 876 MB. make[1]: ディレクトリ '/home/mizutu/ncappzoo/networks/tiny_yolo_v1' から出ます birds: Compiling models to IR... birds: Making the required dependencies... mizutu@ubuntu2004dk:~/ncappzoo/apps/birds$ ls AUTHORS googlenet-v1.xml tiny-yolo-v1_53000.bin Makefile googlenet_processor.py tiny-yolo-v1_53000.xml README.md images tiny_yolo_processor.py birds.py labels.txt googlenet-v1.bin screen_shot.jpg
# from openvino.inference_engine import IENetwork, IECore from openvino.inference_engine import IECore
#from openvino.inference_engine import IENetwork, IECore from openvino.inference_engine import IECore : : # self._gn_net = IENetwork(model = gn_ir, weights = gn_ir[:-3] + 'bin') self._gn_net = ie.read_network(model = gn_ir, weights = gn_ir[:-3] + 'bin')
#from openvino.inference_engine import IENetwork, IECore from openvino.inference_engine import IECore : : # self._ty_net = IENetwork(model = ty_ir, weights = ty_ir[:-3] + 'bin') self._ty_net = ie.read_network(model = ty_ir, weights = ty_ir[:-3] + 'bin')
pi@raspberrypi:~/ncappzoo/apps/birds $ python3 birds.py Running NCS birds example Q to quit, or any key to advance to next image /home/pi/ncappzoo/apps/birds/tiny_yolo_processor.py:44: DeprecationWarning: 'inputs' property of IENetwork class is deprecated. To access DataPtrs user need to use 'input_data' property of InputInfoPtr objects which can be accessed by 'input_info' property. self._ty_input_blob = next(iter(self._ty_net.inputs)) /home/pi/ncappzoo/apps/birds/googlenet_processor.py:41: DeprecationWarning: 'inputs' property of IENetwork class is deprecated. To access DataPtrs user need to use 'input_data' property of InputInfoPtr objects which can be accessed by 'input_info' property. self._gn_input_blob = next(iter(self._gn_net.inputs)) Finished.
mizutu@ubuntu2004dk:~/ncappzoo/apps$ cd classifier_flash mizutu@ubuntu2004dk:~/ncappzoo/apps/classifier_flash$ ls Makefile README.md classifier_flash.gif classifier_flash.py screen_shot.jpg mizutu@ubuntu2004dk:~/ncappzoo/apps/classifier_flash$ make classifier_flash: Making the required data... (cd ../../data/ilsvrc12; make all; cd ../../apps/classifier_flash;) make[1]: ディレクトリ '/home/mizutu/ncappzoo/data/ilsvrc12' に入ります Making all for ilsvrc data... make[1]: ディレクトリ '/home/mizutu/ncappzoo/data/ilsvrc12' から出ます classifier_flash: Compiling default model to IR... make[1]: ディレクトリ '/home/mizutu/ncappzoo/networks/googlenet_v1' に入ります googlenet_v1: Making model zoo... (cd ../../omz; make all;) make[2]: ディレクトリ '/home/mizutu/ncappzoo/omz' に入ります open_model_zoo: Checking requirements... Checking pyyaml... - pyyaml already installed. open_model_zoo: Making dependencies... open_model_zoo: Downloading required data... Open model zoo already exists. No need to clone. make[2]: ディレクトリ '/home/mizutu/ncappzoo/omz' から出ます googlenet_v1: Checking zoo model files... - Model files already exists. googlenet_v1: Compiling model to IR... Intel OpenVINO environment is already set! - IR files already exist. Skipping compile step. make[1]: ディレクトリ '/home/mizutu/ncappzoo/networks/googlenet_v1' から出ます classifier_flash: Making the default model... classifier_flash: Making dependencies... Copying images from images... /bin/sh: 6: rename: not found /bin/sh: 6: rename: not found make: *** [Makefile:30: deps] エラー 127
# from openvino.inference_engine import IENetwork, ExecutableNetwork, IECore from openvino.inference_engine import ExecutableNetwork, IECore : : # net = IENetwork(model=model_xml_fullpath, weights=model_bin_fullpath) net = ie.read_network(model=model_xml_fullpath, weights=model_bin_fullpath)
pi@raspberrypi:~/ncappzoo/apps/classifier_flash $ python3 classifier_flash.py -------------------------------------------------------- Current date and time: 2021-02-20 04:41:34.859885 program arguments: ------------------ num_devices: 1 num_inferences: 500 num_threads_per_device: 3 num_simultaneous_inferences_per_thread: 6 report_interval: 50.0 model_xml: ./googlenet-v1.xml model_bin: ./googlenet-v1.bin image_dir: ./images run_async: True time_threads: True time_main: False show_fps: True use_interval_fps: False display_image_size = 448x448 frames_to_skip = 1 -------------------------------------------------------- classifier_flash.py:632: DeprecationWarning: 'inputs' property of IENetwork class is deprecated. To access DataPtrs user need to use 'input_data' property of InputInfoPtr objects which can be accessed by 'input_info' property. input_blob = next(iter(net.inputs)) Found 41 images. first image index: 0 last_image_index: 12 first image index: 13 last_image_index: 25 first image index: 26 last_image_index: 38 Inferences started. classifier_flash.py:870: DeprecationWarning: 'outputs' property of InferRequest is deprecated. Please instead use 'output_blobs' property. res = handle_list[wait_index][0].outputs[output_blob] 51 inferences completed. FPS: 72.97 103 inferences completed. FPS: 77.65 155 inferences completed. FPS: 84.11 207 inferences completed. FPS: 84.44 259 inferences completed. FPS: 85.06 311 inferences completed. FPS: 84.45 363 inferences completed. FPS: 85.83 415 inferences completed. FPS: 86.76 thread 1 end barrier reached thread 0 end barrier reached 467 inferences completed. FPS: 87.28 thread 2 end barrier reached main end barrier reached Inferences finished. ------------------- Thread timing ----------------------- --- Device: MYRIAD --- Model: ./googlenet-v1.xml --- Total FPS: 91.1 --- FPS per device: 91.1 ---------------------------------------------------------
mizutu@ubuntu2004dk:~/ncappzoo/apps$ cd classifier_grid mizutu@ubuntu2004dk:~/ncappzoo/apps/classifier_grid$ make classifier_grid: Making the required data... (cd ../../data/ilsvrc12; make all; cd ../../apps/classifier_grid;) make[1]: ディレクトリ '/home/mizutu/ncappzoo/data/ilsvrc12' に入ります Making all for ilsvrc data... make[1]: ディレクトリ '/home/mizutu/ncappzoo/data/ilsvrc12' から出ます classifier_grid: Compiling default model to IR... googlenet-v1.xml file already exists, skipping compiliation classifier_grid: Making default models... classifier_grid: Making dependencies... Images folder already exists. } - classifier_grid.py 修正 #codeprettify(){{ # from openvino.inference_engine import IENetwork, ExecutableNetwork, IECore from openvino.inference_engine import ExecutableNetwork, IECore : : # net = IENetwork(model=model_xml_fullpath, weights=model_bin_fullpath) net = ie.read_network(model=model_xml_fullpath, weights=model_bin_fullpath)
pi@raspberrypi:~/ncappzoo/apps/classifier_grid $ python3 classifier_grid.py -------------------------------------------------------- Current date and time: 2021-02-20 04:55:05.198216 program arguments: ------------------ num_devices: 1 num_inferences: 500 num_threads_per_device: 3 num_simultaneous_inferences_per_thread: 6 report_interval: 10 model_xml: ./googlenet-v1.xml model_bin: ./googlenet-v1.bin image_dir: ./images run_async: True time_threads: True time_main: False show_fps: True use_interval_fps: False grid_size = 32x12 canvas_size = 1280x720 frames_to_skip = 1 show_timer = True -------------------------------------------------------- Found 41 images. total_image_count is: 41 classifier_grid.py:538: DeprecationWarning: 'inputs' property of IENetwork class is deprecated. To access DataPtrs user need to use 'input_data' property of InputInfoPtr objects which can be accessed by 'input_info' property. input_blob = next(iter(net.inputs)) first image index: 0 last_image_index: 13 first image index: 14 last_image_index: 27 first image index: 28 last_image_index: 40 Inferences started. classifier_grid.py:840: DeprecationWarning: 'outputs' property of InferRequest is deprecated. Please instead use 'output_blobs' property. res = handle_list[wait_index][0].outputs[out_blob] thread 1 end barrier reached thread 0 end barrier reached thread 2 end barrier reached main end barrier reached thread 0 looping back thread 1 looping back thread 2 looping back : : main end barrier reached thread 2 looping back thread 1 looping back thread 0 looping back ^C Traceback (most recent call last): File "classifier_grid.py", line 887, in <module> sys.exit(main()) File "classifier_grid.py", line 734, in main cv2.waitKey(-1) KeyboardInterrupt ^CException ignored in: <module 'threading' from '/usr/lib/python3.7/threading.py'> Traceback (most recent call last): File "/usr/lib/python3.7/threading.py", line 1281, in _shutdown t.join() File "/usr/lib/python3.7/threading.py", line 1032, in join self._wait_for_tstate_lock() File "/usr/lib/python3.7/threading.py", line 1048, in _wait_for_tstate_lock elif lock.acquire(block, timeout): KeyboardInterrupt
mizutu@ubuntu2004dk:~/ncappzoo/apps$ cd mnist_calc mizutu@ubuntu2004dk:~/ncappzoo/apps/mnist_calc$ make mnist_calc: Compiling default model to IR... (cd ../../networks/mnist; make compile_model;); echo " - Copying IRs to project directory..."; : : download mnist_inference.index done. mnist: Compiling model to IR... Checking OpenVINO environment... Intel OpenVINO environment is already set! /opt/intel/openvino_2021.2.185/deployment_tools/model_optimizer/mo/main.py:85: SyntaxWarning: "is" with a literal. Did you mean "=="? if op is 'k': Model Optimizer arguments: Common parameters: - Path to the Input Model: None - Path for generated IR: /home/mizutu/ncappzoo/networks/mnist/. - IR output name: mnist_inference - Log level: ERROR - Batch: Not specified, inherited from the model - Input layers: Not specified, inherited from the model - Output layers: Not specified, inherited from the model - Input shapes: [1,784] - Mean values: Not specified - Scale values: Not specified - Scale factor: Not specified - Precision of IR: FP16 - Enable fusing: True - Enable grouped convolutions fusing: True - Move mean values to preprocess section: None - Reverse input channels: False TensorFlow specific parameters: - Input model in text protobuf format: False - Path to model dump for TensorBoard: None - List of shared libraries with TensorFlow custom layers implementation: None - Update the configuration file with input/output node names: None - Use configuration file used to generate the model with Object Detection API: None - Use the config file: None Model Optimizer version: 2021.2.0-1877-176bdf51370-releases/2021/2 2021-02-19 10:34:44.938081: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcudart.so.10.1'; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /opt/intel/openvino_2021/data_processing/dl_streamer/lib:/opt/intel/openvino_2021/data_processing/gstreamer/lib:/opt/intel/openvino_2021/opencv/lib:/opt/intel/openvino_2021/deployment_tools/ngraph/lib:/opt/intel/openvino_2021/deployment_tools/inference_engine/external/hddl/lib:/opt/intel/openvino_2021/deployment_tools/inference_engine/external/gna/lib:/opt/intel/openvino_2021/deployment_tools/inference_engine/external/mkltiny_lnx/lib:/opt/intel/openvino_2021/deployment_tools/inference_engine/external/tbb/lib:/opt/intel/openvino_2021/deployment_tools/inference_engine/lib/intel64 : : 2021-02-19 10:34:46.364737: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version [ SUCCESS ] Generated IR version 10 model. [ SUCCESS ] XML file: /home/mizutu/ncappzoo/networks/mnist/./mnist_inference.xml [ SUCCESS ] BIN file: /home/mizutu/ncappzoo/networks/mnist/./mnist_inference.bin [ SUCCESS ] Total execution time: 2.94 seconds. [ SUCCESS ] Memory consumed: 338 MB. make[1]: ディレクトリ '/home/mizutu/ncappzoo/networks/mnist' から出ます - Copying IRs to project directory... mnist_calc: Making default models... mnist_calc: Making dependencies... mnist_calc: No data needed. mizutu@ubuntu2004dk:~/ncappzoo/apps/mnist_calc$ ls AUTHORS calcui.py mnist_inference.bin screen_shot.jpg Makefile mnist_calc.py mnist_inference.xml README.md mnist_calc_600x234.gif mnist_processor.py mizutu@ubuntu2004dk:~/ncappzoo/apps/mnist_calc$
from mnist_processor import MnistProcessor import calcui #from openvino.inference_engine import IENetwork, IEPlugin : : # self._plugin = IEPlugin(device="MYRIAD") # Create processor object for this network # self._net_processor = MnistProcessor(graph_filename, self._plugin) self._net_processor = MnistProcessor(graph_filename) def _do_ncs_cleanup(self): """Clean up the NCAPI resources.""" # del self._plugin self._net_processor.cleanup()
#from openvino.inference_engine import IENetwork, IEPlugin from openvino.inference_engine import IECore : : # self._net = IENetwork(model=network_graph_filename + ".xml", weights=network_graph_filename + ".bin") ie = IECore() self._net = ie.read_network(model=network_graph_filename + ".xml", weights=network_graph_filename + ".bin") self._input_blob = next(iter(self._net.inputs)) self._output_blob = next(iter(self._net.outputs)) # self._exec_net = plugin.load(network=self._net)
pi@raspberrypi:~/ncappzoo/apps/mnist_calc $ python3 mnist_calc.py /home/pi/ncappzoo/apps/mnist_calc/mnist_processor.py:40: DeprecationWarning: 'inputs' property of IENetwork class is deprecated. To access DataPtrs user need to use 'input_data' property of InputInfoPtr objects which can be accessed by 'input_info' property. self._input_blob = next(iter(self._net.inputs)) /home/pi/ncappzoo/apps/mnist_calc/mnist_processor.py:142: DeprecationWarning: 'outputs' property of InferRequest is deprecated. Please instead use 'output_blobs' property. output = self._req_handle.outputs[self._output_blob] value: 4 probability: 1.0 value: 3 probability: 1.0
mizutu@ubuntu2004dk:~/ncappzoo/apps$ cd simple_classifier_py_camera mizutu@ubuntu2004dk:~/ncappzoo/apps/simple_classifier_py_camera$ make simple_classifier_py: Compiling the model to IR... - making squeezenet IRs in squeezenet project. make[1]: ディレクトリ '/home/mizutu/ncappzoo/networks/squeezenet_v1.0' に入ります : : squeezenet_v1.0: Compiling model to IR... Checking OpenVINO environment... Intel OpenVINO environment is already set! /opt/intel/openvino_2021.2.185/deployment_tools/model_optimizer/mo/main.py:85: SyntaxWarning: "is" with a literal. Did you mean "=="? if op is 'k': Model Optimizer arguments: Common parameters: - Path to the Input Model: /home/mizutu/ncappzoo/networks/squeezenet_v1.0/../../omz/open_model_zoo/tools/downloader/classification/squeezenet/1.0/caffe/sque ezenet1.0.caffemodel - Path for generated IR: /home/mizutu/ncappzoo/networks/squeezenet_v1.0/. - IR output name: squeezenet1.0 - Log level: ERROR - Batch: Not specified, inherited from the model - Input layers: Not specified, inherited from the model - Output layers: Not specified, inherited from the model - Input shapes: Not specified, inherited from the model - Mean values: [104,117,123] - Scale values: Not specified - Scale factor: Not specified - Precision of IR: FP16 - Enable fusing: True - Enable grouped convolutions fusing: True - Move mean values to preprocess section: None - Reverse input channels: False Caffe specific parameters: - Path to Python Caffe* parser generated from caffe.proto: /opt/intel/openvino_2021/deployment_tools/model_optimizer/mo/front/caffe/proto - Enable resnet optimization: True - Path to the Input prototxt: /home/mizutu/ncappzoo/networks/squeezenet_v1.0/../../omz/open_model_zoo/tools/downloader/classification/squeezenet/1.0/caffe/ squeezenet1.0.prototxt - Path to CustomLayersMapping.xml: Default - Path to a mean file: Not specified - Offsets for a mean file: Not specified Model Optimizer version: 2021.2.0-1877-176bdf51370-releases/2021/2 2021-02-19 10:45:56.594947: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcudart.so.10.1'; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /opt/intel/openvino_2021/data_processing/dl_streamer/lib:/opt/intel/openvino_2021/data_processing/gstreamer/lib:/opt/intel/openvino_2021/opencv/lib:/opt/intel/openvino_2021/deployment_tools/ngraph/lib:/opt/intel/openvino_2021/deployment_tools/inference_engine/external/hddl/lib:/opt/intel/openvino_2021/deployment_tools/inference_engine/external/gna/lib:/opt/intel/openvino_2021/deployment_tools/inference_engine/external/mkltiny_lnx/lib:/opt/intel/openvino_2021/deployment_tools/inference_engine/external/tbb/lib:/opt/intel/openvino_2021/deployment_tools/inference_engine/lib/intel64 2021-02-19 10:45:56.595028: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. [ SUCCESS ] Generated IR version 10 model. [ SUCCESS ] XML file: /home/mizutu/ncappzoo/networks/squeezenet_v1.0/./squeezenet1.0.xml [ SUCCESS ] BIN file: /home/mizutu/ncappzoo/networks/squeezenet_v1.0/./squeezenet1.0.bin [ SUCCESS ] Total execution time: 4.25 seconds. [ SUCCESS ] Memory consumed: 279 MB. make[1]: ディレクトリ '/home/mizutu/ncappzoo/networks/squeezenet_v1.0' から出ます - copying IRs to project folder... simple_classifier_py: Making dependencies... simple_classifier_py: Making the required data... make[1]: ディレクトリ '/home/mizutu/ncappzoo/data/ilsvrc12' に入ります Making all for ilsvrc data... make[1]: ディレクトリ '/home/mizutu/ncappzoo/data/ilsvrc12' から出ます mizutu@ubuntu2004dk:~/ncappzoo/apps/simple_classifier_py_camera$ ls AUTHORS README.md screen_shot.jpg squeezenet1.0.xml Makefile run.py squeezenet1.0.bin
# from openvino.inference_engine import IENetwork, IEPlugin from openvino.inference_engine import IECore : : # plugin = IEPlugin(device='MYRIAD') ie = IECore() # net = IENetwork(model = ARGS.ir, weights = ARGS.ir[:-3] + 'bin') net = ie.read_network(model = ARGS.ir, weights = ARGS.ir[:-3] + 'bin') # Set up the input and output blobs input_blob = next(iter(net.inputs)) output_blob = next(iter(net.outputs)) # Load the network and get the network shape information # exec_net = plugin.load(network = net) exec_net = ie.load_network(network = net, device_name = "MYRIAD")
pi@raspberrypi:~/ncappzoo/apps/simple_classifier_py_camera $ python3 run.py run.py:62: DeprecationWarning: 'inputs' property of IENetwork class is deprecated. To access DataPtrs user need to use 'input_data' property of InputInfoPtr objects which can be accessed by 'input_info' property. input_blob = next(iter(net.inputs)) Starting application... - Camera Source: 0 - Plugin: Myriad - IR File: ../../networks/squeezenet_v1.0/squeezenet1.0.xml - Input Shape: [1, 3, 227, 227] - Output Shape: [1, 1000, 1, 1] - Labels File: ../../data/ilsvrc12/synset_labels.txt - Mean File: None Press any key to exit. run.py:125: DeprecationWarning: 'outputs' property of InferRequest is deprecated. Please instead use 'output_blobs' property. results = req_handle.outputs[output_blob] Frame per second: 58.10 Finished.
mizutu@ubuntu2004dk:~/ncappzoo/apps$ cd simple_classifier_py mizutu@ubuntu2004dk:~/ncappzoo/apps/simple_classifier_py$ make simple_classifier_py: Compiling the model to IR... - Making squeezenet IRs in squeezenet project. make[1]: ディレクトリ '/home/mizutu/ncappzoo/networks/squeezenet_v1.0' に入ります squeezenet_v1.0: Making model zoo... (cd ../../omz; make all;) : : squeezenet_v1.0: Compiling model to IR... Checking OpenVINO environment... Intel OpenVINO environment is already set! - IR files already exist. Skipping compile step. make[1]: ディレクトリ '/home/mizutu/ncappzoo/networks/squeezenet_v1.0' から出ます - Copying IRs to project folder... simple_classifier_py: Making default models... simple_classifier_py: Making dependencies... simple_classifier_py: Making the required data... make[1]: ディレクトリ '/home/mizutu/ncappzoo/data/ilsvrc12' に入ります Making all for ilsvrc data... make[1]: ディレクトリ '/home/mizutu/ncappzoo/data/ilsvrc12' から出ます
# from openvino.inference_engine import IENetwork, IECore from openvino.inference_engine import IECore : : # net = IENetwork(model = ir, weights = ir[:-3] + 'bin') net = ie.read_network(model = ir, weights = ir[:-3] + 'bin')
pi@raspberrypi:~/ncappzoo/apps/simple_classifier_py $ python3 run.py run.py:68: DeprecationWarning: 'inputs' property of IENetwork class is deprecated. To access DataPtrs user need to use 'input_data' property of InputInfoPtr objects which can be accessed by 'input_info' property. input_blob = next(iter(net.inputs)) Starting application... - Plugin: Myriad - IR File: ../../networks/squeezenet_v1.0/squeezenet1.0.xml - Input Shape: [1, 3, 227, 227] - Output Shape: [1, 1000, 1, 1] - Labels File: ../../data/ilsvrc12/synset_labels.txt - Mean File: None - Image File: ../../data/images/nps_electric_guitar.png ********** Results *********** Prediction is 93.8% electric guitar
mizutu@ubuntu2004dk:~/ncappzoo/apps/benchmark_ncs$ make benchmark_ncs: No data needed. benchmark_ncs: Compiling the model make[1]: ディレクトリ '/home/mizutu/ncappzoo/networks/googlenet_v1' に入ります googlenet_v1: Making model zoo... (cd ../../omz; make all;) make[2]: ディレクトリ '/home/mizutu/ncappzoo/omz' に入ります open_model_zoo: Checking requirements... Checking pyyaml... - pyyaml already installed. open_model_zoo: Making dependencies... open_model_zoo: Downloading required data... Open model zoo already exists. No need to clone. make[2]: ディレクトリ '/home/mizutu/ncappzoo/omz' から出ます googlenet_v1: Checking zoo model files... - Model files already exists. googlenet_v1: Compiling model to IR... Intel OpenVINO environment is already set! - IR files already exist. Skipping compile step. make[1]: ディレクトリ '/home/mizutu/ncappzoo/networks/googlenet_v1' から出ます benchmark_ncs: Making the default model... benchmark_ncs: Making dependencies...
# from openvino.inference_engine import IENetwork, ExecutableNetwork, IECore from openvino.inference_engine import ExecutableNetwork, IECore : : # net = IENetwork(model=model_xml_fullpath, weights=model_bin_fullpath) net = ie.read_network(model=model_xml_fullpath, weights=model_bin_fullpath)
pi@raspberrypi:~/ncappzoo/apps/benchmark_ncs $ python3 benchmark_ncs.py -------------------------------------------------------- Current date and time: 2021-02-20 09:38:27.297474 program arguments: ------------------ device: MYRIAD num_devices: 1 num_inferences: 1000 num_threads_per_device: 3 num_simultaneous_inferences_per_thread: 6 report_interval: 100 model_xml: ./googlenet-v1.xml model_bin: ./googlenet-v1.bin image_dir: ./images run_async: True time_threads: True time_main: False -------------------------------------------------------- benchmark_ncs.py:354: DeprecationWarning: 'inputs' property of IENetwork class is deprecated. To access DataPtrs user need to use 'input_data' property of InputInfoPtr objects which can be accessed by 'input_info' property. input_blob = next(iter(net.inputs)) Found 10 images. Inferences started... benchmark_ncs.py:538: DeprecationWarning: 'outputs' property of InferRequest is deprecated. Please instead use 'output_blobs' property. result = handle_list[wait_index].outputs[output_blob] 101 inferences completed. Current fps: 86.4 202 inferences completed. Current fps: 87.0 303 inferences completed. Current fps: 89.5 404 inferences completed. Current fps: 89.5 505 inferences completed. Current fps: 90.1 606 inferences completed. Current fps: 90.4 707 inferences completed. Current fps: 90.6 808 inferences completed. Current fps: 90.7 909 inferences completed. Current fps: 91.0 Thread 1 end barrier reached Thread 0 end barrier reached Thread 2 end barrier reached Main end barrier reached Inferences finished. ------------------- Thread timing ----------------------- --- Device: MYRIAD --- Model: ./googlenet-v1.xml --- Total FPS: 92.5 --- FPS per device: 92.5 ---------------------------------------------------------