This step-by-step tutorial will help guide you through extending a model with AWS DeepLens. AWS DeepLens is a fully programmable video camera that comes with tutorials, code, and pre-trained models designed to expand deep learning skills.
In this tutorial, you will capture the events from your AWS DeepLens model and put them in a queue ready for further processing. There are many use cases to extend the output AWS DeepLens models utilizing AWS Lambda functions, such as sending alerts, opening doors, populating analytical dashboards, to name just a few (see step 3.c. in this tutorial).
You will need an AWS DeepLens device in order to complete this tutorial. You can pre-order now on amazon.com.
Open the AWS Management Console in a new browser window, so you can keep this step-by-step guide open. When the screen loads, enter your user name and password to get started. Then type DeepLens in the search bar and select AWS DeepLens to open the console.
a. When you open the AWS DeepLens console you may have different views based on your recent actions. Select the Hamburger Menu symbol on the top left to see the list of views.
b. Choose Devices view, and select your device from the list.
c. Scroll down the MyDevice screen and select and copy the MQTT Topic Name at the bottom.
e. In the MQTT client, select the Test section from the list on the left, and paste the MQTT Topic Name that you copied in step 2-c of this tutorial to the Subscription topic field and select Subscribe to topic.
f. Verify that you see some messages from the device.
Note: You can also verify that your model is running by opening the output stream as described in the Creating and Deploying an AWS DeepLens Project tutorial.
a. Start by choosing the Act section in the left navigation on the AWS IoT Console and select Create a rule.
b. Input a name for the new rule (e.g. ObjectDetectionRule), and in the Message source section define the Attribute to be “*” (All) and paste the Topic name from step 2-c of this tutorial into theTopic filter field.
Scroll down to the actions section and select Add action.
c. Now its time to add an action. There are many options for the events that are captured by the IoT Rule Engine, some for processing and some for storage and analytics. Select the option to Send a message to an SQS queue, scroll down and select Configure action.
d. You can choose an existing SQS queue or create a new one. Select Create a new resource.
e. Name the new queue (e.g. ObjectDetectionOutput), scroll down and select Quick-Create Queue.
f. Refresh the list of SQS queues and select the queue that you just created.
h. Name to the new role (e.g. ObjectDetectionQueueRole), and select Create a new role.
i. Refresh the list of IAM roles and choose the newly created role.
j. Scroll down and select Add action.
k. Now you're ready to complete the rule creation. Scroll down and select Create rule.
b. Select the newly create queue name from the list.
c. Go to the Queue Actions dropdown list and select View/Delete Messages.
d. A window will popup, select Start Polling for Messages.
e. If your model is running, and your device is connected, you should be able to see a few messages from the output of the inference project appearing in the queue.
f. If you don’t see any messages in the queue, you can start a media player and watch your project's video stream using the command (Creating and Deploying an AWS DeepLens Project tutoria): mplayer -demuxer lavf -lavfdopts format=mjpeg:probesize=32 /tmp/results.mjpeg.