项目作者: michhar

项目描述 :
Sample of using PyTorch for inference in an Azure IoT Edge Module.
高级语言: Python
项目地址: git://github.com/michhar/iot-edge-classification-module.git
创建时间: 2019-01-27T03:17:00Z
项目社区:https://github.com/michhar/iot-edge-classification-module

开源协议:

下载


Azure IoT Edge Classification Module

This uses a PyTorch Squeezenet model for image classification encapsulated in an Azure IoT Edge module for running on Edge Devices or in the Simulator.

Prerequisites

  1. Docker (Community Edition) for Mac or Windows
  2. Visual Studio Code (VSCode) text editor with IoT Edge extension (to get this go to View -> Extensions and type in “IoT Edge”, select “Azure IoT Edge”) - alternatively all of the work may be done on the command line as is shown in this tutorial.
  3. Azure IoT Hub resource in the Azure Cloud
  4. Azure IoT Edge Device in said Hub
  5. Set up the Azure IoT Edge Dev Tool which provides a simulation environment for IoT Edge Modules

Instructions

Follow the Quickstart at https://github.com/Azure/iotedgedev. See the Wiki for more information and instructions.

Building the module with the simulator tool, iotedgedev, will produce output like:

The next step (combined command to setup and start simulator) will produce output like:

The final step, monitoring the simulated module, will produce output like:

Contribute

Issues and Pull Requests are welcome.

Troubleshooting

If you need a .env file in the running docker container created above, it will help to have an editor like vim. Install into the container with:

  1. sudo apt-get update && sudo apt-get install vim
  2. sudo vim .env

Then to add the system variables listed in the .env just “source” it in Unix environments:

  1. source .env

To check the logs of a particular container (e.g. the IoT Edge Module) run:

  1. sudo docker logs <CONTAINER ID>

Additional Notes