566
社区成员
import openvino.inference_engine as ie
import cv2
import numpy
import time
def main():
####################### Device Initialization ########################
# Plugin initialization for specified device and load extensions library if specified
plugin = ie.IEPlugin(device="MYRIAD")
#########################################################################
To set the inference device as the Intel Neural Compute Stick 2 (NCS2) in OpenVINO, you can follow these steps:
First, make sure that you have installed the OpenVINO toolkit and the Intel Neural Compute SDK on your system.
Connect your Intel NCS2 device to your computer and ensure that it is properly recognized by your system.
Set the environment variables required for OpenVINO and the Intel Neural Compute SDK by running the following commands in a terminal or command prompt:
bash
Copy code
source /opt/intel/openvino/bin/setupvars.sh
source /opt/intel/openvino_2021.4.582/deployment_tools/inference_engine/external/97-myriad-usbboot.rules
sudo udevadm control --reload-rules && udevadm trigger
Navigate to the directory containing the OpenVINO sample code that you want to run.
Use the following command to run the sample code with the Intel NCS2 device:
php
Copy code
./.sh -d MYRIAD
Replace with the name of the sample code that you want to run.
The -d flag specifies the target device, which in this case is MYRIAD, the code name for the Intel NCS2 device.
The sample code will run and output the inference results to the console or to a file, depending on the sample.
Note that the specific steps may vary depending on your system configuration and the version of OpenVINO and the Intel Neural Compute SDK that you are using. Be sure to consult the OpenVINO documentation for more information on using the Intel NCS2 with OpenVINO.