Table of contents
1.
Introduction
2.
Machine Learning Frameworks Supported by AWS DeepLens
2.1.
Supported MXNet Models and Supporting MXNet Layers
2.2.
Supported TensorFlow Models and Supporting TensorFlow Layers
2.3.
Supported Caffe Models and Supporting Caffe Layers
3.
Viewing AWS DeepLens Output Streams
4.
AWS DeepLens Sample Projects
5.
Working with AWS DeepLens Custom Projects
6.
Frequently Asked Questions
7.
Conclusion
Last Updated: Mar 27, 2024
Easy

Building AWS DeepLens Projects

Author vishal teotia
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

AWS DeepLens can be integrated with a variety of AWS services. These services allow you to create, train, and launch AWS DeepLens projects. To create an AWS DeepLens-based project, you will need an AWS account.
 

Having registered and connected your AWS DeepLens device to the AWS Cloud, you can now create an AWS DeepLens project and deploy it to the device. AWS DeepLens is a computer vision application based on deep learning. It includes a deep learning model and a Lambda function for performing inference.
 

An AWS DeepLens–based project requires four components.

  1. Data collection and storage: Gather your data and upload it to an Amazon S3 bucket.
  2. Model training: Use a Jupyter Notebook within Amazon SageMaker.
  3. Deploy your model: Deploy the trained model to your AWS DeepLens device using AWS Lambda.
  4. View model output: After the model has been deployed; you can view its output with Amazon IoT Greengrass.

Machine Learning Frameworks Supported by AWS DeepLens

In addition to Gluon API support, Amazon DeepLens supports deep learning models trained using Apache MXNet, TensorFlow, and Caffe. This section lists the models and modeling layers that AWS DeepLens supports for each framework.

Supported MXNet Models and Supporting MXNet Layers

The following Apache MXNet deep learning models are supported by AWS DeepLens and are exposed by the Gluon API.

Model Description
ResNet Image classification model trained on ImageNet dataset imported from the MXNet.
AlexNet Image classification model trained on ImageNet dataset imported from Open Neural Network Exchange (ONNX).
SqueezeNet Image classification model trained on ImageNet dataset imported from the ONNX.
MobileNet Image classification model trained in TensorFlow using RMSprop optimizer.
VGG Image classification model trained on  ImageNet dataset imported from the MXNet or ONNX.

The following Apache MXNet modeling layers can be used to train a deep learning model for AWS DeepLens.

Layer Description
BatchNorm Applies batch normalization.
Activation Applies an activation function to input.
InputLayer Specifies input to a neural network.
Convolution Applies convolution layer on the input.
L2Norm Applies L2 normalization to input array.

Supported TensorFlow Models and Supporting TensorFlow Layers

AWS supports the following TensorFlow deep learning models

Model Description
ResNet An image classification model trained on the ImageNet dataset using the TensorFlow.
Inception Image classification model trained on ImageNet dataset imported from Open Neural Network Exchange (ONNX).
NasNet An image classification model trained on the ImageNet dataset using the TensorFlow.
MobileNet Image classification model trained in TensorFlow. 
VGG Image classification model trained on ImageNet dataset in TensorFlow.

 

The following TensorFlow modeling layers can be used to train a deep learning model for AWS DeepLens.

Layer Description
Add Computes element-wise addition.
Conv2D Computes 2-D convolution.
Reshape Reshape tensor.
Mul Computes element-wise multiplication.
Pad Pads a tensor.

Supported Caffe Models and Supporting Caffe Layers

AWS DeepLens supports the following Caffe models.

Model Description
ResNet An image classification model trained on the ImageNet dataset using the Caffe.
Inception An image classification model converted from the original Apache MXNet model.
ResNet An image classification model trained on the ImageNet dataset using the Caffe.
MobileNet Image classification model trained in Caffe. 
VGG Image classification model trained on the ImageNet dataset in Caffe.

The following Caffe modeling layers can be used to train a deep learning model for AWS DeepLens.

Layer Description
ReLU Computes the rectified linear activations.
Softmax Computes Softmax activations.
Reshape Changes dimensions of the input blob without changing its data.
Tile Copies blob along specified dimensions.
Permute Permutes dimensions of a blob.

Viewing AWS DeepLens Output Streams

AWS DeepLens devices produce two streams of output: a project stream and a device stream. Device streams are raw video streams. Project streams are the outcomes of the model's processing of the video frames. 
When your AWS DeepLens device is online, you can view the output using a supported web browser. Additionally, the output can be viewed on a device connected to a monitor, a keyboard, and a mouse.

 

 

Must Read Apache Server

Steps to view an unprocessed stream or a project stream on your AWS DeepLens device:

  1. Plug your AWS DeepLens device into a power outlet and turn it on.
  2. Connect USB mouse and keyboard to your AWS DeepLens.
  3. Use a micro HDMI cable to connect your AWS DeepLens to monitor. A login screen will appear on the monitor.
  4. Sign in to the device using the SSH password you set when registering the device.
  5. To see an unprocessed stream from your AWS DeepLens, start your terminal and run the following command:mplayer -demuxer lavf /opt/awscam/out/ch1_out.h264

To see the project stream from your AWS DeepLens, start your terminal and run the following command:

MPlayer -demuxer lavf-lavfdopts format=mjpeg:probesize=32 /tmp/results

6. Press Ctrl+C to stop viewing the video stream and end your terminal session.

AWS DeepLens Sample Projects

The sample projects in AWS DeepLens come pre-trained so that all you need to do is create a project, import the model, deploy the project and run the project.

  1. Artistic Style Transfer: As a result of this project, the style of an image can be transferred to an entire video sequence captured by AWS DeepLens.
  2. Object Recognition: This project demonstrates how a deep learning model can find and recognize objects in a room.
  3. Face Detection and Recognition: In this project, you use a face detection model and an AWS DeepLens device to detect people's faces in a room.
  4. Action Recognition: This project recognizes 37 kinds of activities.


To create and deploy the AWS DeepLens sample project using the AWS DeepLens console:

  1. Open AWS DeepLens console at https://console.aws.amazon.com/deeplens/.
  2. Choose Projects, then choose to create a new project.
  3. On the Choose project type screen
    1. Choose Use a project template, then choose the sample project you want to create.
    2. Scroll to the bottom of the screen, then choose Next.
  4. On Specify project details screen
    1. In the Project Information section:
      1. Either type a name you prefer or accept the default name for the project.
      2. Either type a description you 
      3. like or accept the default description for the project.
    2. Choose to Create.
    3. You'll be returned to the Projects page, with your newly created project listed alongside your other projects.
  5. From the Projects screen, select the radio button to the left of your project name or choose the project to open its details page, then select Deploy to 
  6. the device.
  7. From the list of AWS DeepLens devices on the Target device screen, choose the radio button to the left of the device that you want to deploy this project to. An AWS DeepLens device can have only one project deployed to it at one time.
  8. Choose Review.
  9. You will receive an error message if a project is already deployed on the device, stating that deploying this project will overwrite the existing project. Choose Continue project.
  10. This will take you to Review and deploy screen.
  11. On Review and deploy screen, review your project and choose either Previous to go back and make changes, or Deploy to deploy the project.
     

Read more, Amazon Hirepro
 

Working with AWS DeepLens Custom Projects

If you have explored a few sample projects, you might want to create and deploy your own AWS DeepLens project. This means that you should do all of the following or most of them.

  • Train one custom deep learning model either in SageMaker or elsewhere.
  • Import model into AWS DeepLens.
  • Create and publish inference function.
  • Create AWS DeepLens project and add the model and the inference function to it.
  • Deploy project to your AWS DeepLens device.

Frequently Asked Questions

  1. What is SageMaker?
    Data scientists and developers can build, train, and deploy machine learning models at any scale using Amazon SageMaker, a fully-managed service provided by Amazon.
     
  2. What geographic regions is AWS DeepLens available in?
    AWS DeepLens is available in the US, Germany, France, Italy, Spain, UK, Japan, and Canada.
     
  3. What is AWS DeepLens?
    AWS DeepLens is the world's first deep learning camera that enables developers at any stage of their machine learning journey to improve their capabilities through hands-on computer vision tutorials, example code, and pre-built models.

Conclusion

AWS Deeplens is a powerful tool for both beginner and accustomed data scientists as it provides sample project and gives freedom to make custom project as well.


Check out this link if you are a Machine Learning enthusiast or want to brush up on your knowledge with ML blogs.

Do not stress about upcoming Campus Placements. Coding Ninjas has you covered. Visit this link for a carefully crafted and designed course on on-campus placements and interview preparation.

Live masterclass