Deploy a Vision AI Model with Visual Studio Code
What you will do
- Configure VS Code for model deployment
- Deploy a pre-built sample model container image to the Visual AI DevKit hardware
What you will need
- Visual Studio (VS) Code with required extentions (Instructions)
- Vision Dev Kit sample model - GitHub repository.
- Azure IoT Hub and Azure IoT Edge device configured for your Vision AI DevKit hardware (Instructions)
- Active Wi-Fi access point with Internet connectivity
- ADB command line utility (Instructions)
- (optional) HDMI cable and monitor to view video from the Visual AI DevKit.
Deploy the sample model container image to the Vision AI DevKit
- Download or Clone the latest Vision AI DevKit repository from GitHub.
- Launch Visual Studio Code, and select [File > Open Folder…] command to open the “VisionSample” directory as the workspace root.
- Right click the deployment.template.json file under the VisionSample\DeployContainerFromAML folder and select Generate IoT Edge Deployment Manifest to create a new deployment.json file under VisionSample\DeployContainerFromAML\config folder.
- Click the [Explorer] icon, then click […] in the AZURE IOT HUB DEVICES section on the right side. Click Select IoT Hub to select your Azure IoT Hub.
- Expand the AZURE IOT HUB DEVICES section. Right-click your IoT Edge device, then select Create Deployment for Single Device. Click the deployment.json file under the VisionSample\DeployContainerFromAML\config folder, then click the Select Edge Deployment Manifest button to deploy the container image to the IoT Edge device (your Vision AI DevKit hardware).
- Configure the device as an IoT Edge device using the connection string for your Vision AI DevKit, obtained earlier.
- Monitor the deployment status for the AI Vision Kit device by the command lines
adb shell docker ps adb shell docker logs edgeAgent
Check object detection results using the command line
adb shell iotedge logs <module name> (e.g. “adb shell iotedge logs VisionSampleImagenet”)
Mobilenet-imagenet model can detect the 1000 object classes listed in the VisionSample\MachineLearning\models\mobilenet-imagenet\orig\output_labels.txt.
In VS Code, select AZURE IOT HUB DEVICES > … > Select IoT Hub and then AZURE IOT HUB DEVICES > … > Start Monitoring D2C Message command to monitor the messages sent from the AI Vision DevKit to your Azure IoT Hub.
Verify output on the monitor
Connect the HDMI cable to the Vision AI DevKit hardware and your monitor. A few minutes after submitting your deployment, you should start to see video on the monitor with bounding boxes drawing around objects the camera can see and evaluate.
Note: You can also view the camera output using an RTSP compatible video player. See View RTSP video stream for more information.