Starting January 31, 2024, you will no longer be able to access AWS DeepLens through the AWS Management Console, manage DeepLens devices, or access any projects you have created. To export projects and learn more, use this step-by-step guide.

With Amazon SageMaker

This step-by-step tutorial will help guide you though creating a model using Amazon SageMaker and importing it to an AWS DeepLens model. AWS DeepLens is a fully programmable video camera that comes with tutorials, code, and pre-trained models designed to expand deep learning skills.

You will need an AWS DeepLens device in order to complete this tutorial. You can pre-order now on amazon.com.

If this is your first time using your AWS DeepLens check out the How to Configure AWS DeepLens and the Creating and Deploying an AWS DeepLens Project tutorials to help you get started.

Completing this tutorial requires an AWS account

Create a Free Account

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 SageMaker in the search bar and select Amazon SageMaker to open the console.

(click to zoom)

In this step, you will set up and configure an Amazon SageMaker notebook instance.


a. Launch an Amazon SageMaker notebook by selecting Create notebook instance in the Get started section on the right side of the screen.

 

 

(click to zoom)


b. Under the Notebook instance settings section complete the following steps: 1) Give your notebook a name (for example, “HotDogDetection”), 2) Select a Notebook instance type (for example, ml.t2.medium, which is the smallest and lower cost), and 3) Select Create a new role.

(click to zoom)


c. On the Create an IAM role screen, under S3 buckets you specify - optional, select None. Keep all the other default values as is to allow SageMaker related buckets and objects to be accessed. Select Create role.

(click to zoom)


d. Back on the Create Notebook instance screen, select the IAM role that you just created in step 2.c. and then select Create notebook instance. The other values for VPC and KMS are not necessary for this simple tutorial, but should be used when using real private data.

(click to zoom)


e. Return to Amazon SageMaker Console, wait for the notebook status to turn from Pending to InService and select Open.

(click to zoom)

In this step, you will work within the Jupyter notebook, import a model from github, link it to an S3 bucket, and run cells.


a. Once the Jupyter notebook is open, select New and then Terminal, to open a new terminal to retrieve the tutorial notebook. You will use the tutorial notebook to a custom model.

(click to zoom)


b. Now, you will retrieve the notebook from the git repository. In the terminal, change to the SageMaker directory by entering: cd SageMaker . Next, clone the repository from GitHub by entering: git clone https://github.com/aws-samples/reinvent-2017-deeplens-workshop.git

(click to zoom)


c. Return to the Jupyter Home screen and navigate to the notebook by selecting the reinvent-2017-deeplens-workshop folder.

(click to zoom)


d. In the folder, navigate to the lab session 3 folder, and select the notebook named deeplens-hotdog-or-not-hotdog.ipynb.

(click to zoom)


e. To write its output the model needs an S3 Bucket. So, now open the S3 Console, and select Create Bucket.

(click to zoom)


f. Name the bucket with the deeplens-sagemaker- prefix, to allow AWS DeepLens and Amazon SageMaker to access it, and append it with your name for uniqueness. Under Region, select US East (N. Virginia), to align with the notebook region, and select Create in the bottom left corner.

(click to zoom)


g. Next, scroll down the notebook cells to the cell with the S3 Bucket name, and assign the name of the S3 bucket you created (for example, deeplens-sagemaker-myname), and from the Cell menu at the top of the Jupyter page select the option Run all.


 

(click to zoom)

In this final step, you will learn how to import the model you just created into an AWS DeepLens model.


a. Once all the cells have finished running (this is indicated by the * beside each cell turning into a sequence number), navigate to the AWS DeepLens Console and select Models then Import model.
 

(click to zoom)


b. In the Import source section, select Externally trained model, and under Model settings, point to the S3 Bucket you created and the folder that was used to output the model (for example, S3://deeplens-sagemaker-myname/test/). Give it a name (for example, Hotdog-or-not) and a description, then select Import.
 

(click to zoom)


c. To verify the model import, navigate to the Models page. The newly created model should appear in the list of available models, after the list of the built-in models. The model is ready now to be included in a project and deployed to your device.

(click to zoom)

You have created your first model using Amazon SageMaker and imported it to an AWS DeepLens model! 

You can now include this in a project alongside an AWS Lambda function, and deploy it to the camera for local inference.

Now that you have deployed a model to AWS DeepLens, pick one of the following options to further expand your knowledge.

Dive deeper

Get more info on how to use AWS DeepLens.

Getting Started Guide >>

Learn more

Learn how to customize and display project output from AWS DeepLens on an HTML page. 

Read the Blog Post >>

Build a project

Get an overview of training a model with Amazon SageMaker and extending it with AWS Lambda.

Read the Blog Post >>