Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Follow the modules below or refer to the online course to learn how to build the
* Click Next

4. Leave the default values for Configure Options screen and click Next
5. Under Set permissions, uncheck all the four checkboxes. NOTE: This step would allow us to make objects in your S3 bucket public. We are doing this to reduce a few steps in the module, but you should not do that for production workloads. Instead we recommended to use S3 Pre-Signed URLs to give time limited access to objects in S3.
5. Under Set permissions, ensure all checkboxes are *not* checked. NOTE: This step would allow us to make objects in your S3 bucket public. We are doing this to reduce a few steps in the module, but you should not do that for production workloads. Instead we recommended to use S3 Pre-Signed URLs to give time limited access to objects in S3.
6. Click Next, and click Create bucket.

### Create a cloud Lambda function
Expand All @@ -73,7 +73,7 @@ Follow the modules below or refer to the online course to learn how to build the

* Name: worker-safety-cloud
* Runtime: Python 3.7
* Role: Choose an existing role
* Execution Role: Choose "Use an existing role"
* Existing role: RecognizeObjectLambdaRole
* Click Create function

Expand All @@ -82,44 +82,44 @@ Follow the modules below or refer to the online course to learn how to build the
* Key: iot_topic
* Value: worker-safety-demo-cloud

1. Download [lambda.zip](./code/lambda.zip).
1. Download the function code via this link: [lambda.zip](./code/lambda.zip).
2. Under Function code:

* Code entry type: Upload a zip file
* Under Function package, click Upload and select the zip file you downloaded in earlier step.
* Click Save.

1. Under Add triggers, select S3.
1. Back at the top in the Designer section, click "Add trigger", then select S3.
2. Under Configure triggers:

* Bucket: Select the S3 bucket you just created in earlier step.
* Event type: Leave default Object Created (All)
* Event type: Leave default (All object create events)
* Leave defaults for Prefix and Suffix and make sure Enable trigger checkbox is checked.
* Click Add.
* Click Save on the top right to save the changes to the Lambda function.

### Create an AWS DeepLens inference Lambda function

1. Go to AWS Lambda in AWS Console at https://console.aws.amazon.com/lambda/.
1. Go to AWS Lambda in the AWS Console at https://console.aws.amazon.com/lambda/.
2. Click on Create function.
3. Under Create function, select Blueprints.
3. Under Create function, select "Use a blueprint".
4. Under Blueprints, type greengrass and hit enter to filter blueprint templates.
5. Select greengrass-hello-world and click Configure.
6. Under Basic information, provide the following details:

* Name: name-worker-safety-deeplens (example: kashif-worker-safety-deeplens)
* Role: Choose and existing role
* Function name: name-worker-safety-deeplens (example: kashif-worker-safety-deeplens)
* Execution Role: Choose "Use an existing role"
* Existing role: DeepLensInferenceLambdaRole
* Click Create function.

1. Copy the code from [deeplens-lambda.py](./code/deeplens-lambda.py) and paste it under the Function code for the Lambda function.
2. Go to line 34 and modify the line below with the name of your S3 bucket created in the earlier step.
1. Go to this [deeplens-lambda.py](./code/deeplens-lambda.py) in another tab, click the "Raw" button, then select all and copy the code to your clipboard.
2. Go back to your Lambda function configuration tab and paste the code under the Function code section, overwriting greengrassHelloWorld.py.
3. Go to line 34 and modify the line below with the name of your S3 bucket created in the earlier step.

* bucket_name = "REPLACE-WITH-NAME-OF-YOUR-S3-BUCKET"

1. Click Save.
2. Click on Actions, and then "Publish new version".
3. For Version description enter: Detect a person and push frame to S3 bucket. and click Publish.
3. For Version description enter: "Detect a person and push frame to S3 bucket.", then click Publish.

### Create an AWS DeepLens project

Expand Down Expand Up @@ -149,8 +149,9 @@ Follow the modules below or refer to the online course to learn how to build the
### View output in AWS IoT

1. Go to AWS IoT console at https://console.aws.amazon.com/iot/home
2. Under Subscription topic, enter the topic name that you entered as an environment variable for the Lambda function you created in the earlier step (example: worker-safety-demo-cloud) and click Subscribe to topic.
3. You should now see JSON message with a list of people detected and whether they are wearing safety hats or not.
2. In the left-hand sidebar, click "Test".
3. Under Subscription topic, enter the topic name that you entered as an environment variable for the Lambda function you created in the earlier step (example: worker-safety-demo-cloud) and click Subscribe to topic.
4. You should now see JSON message with a list of people detected and whether they are wearing safety hats or not.

### View output in Amazon CloudWatch

Expand Down