Skip to content

Commit b175412

Browse files
author
Jacob Cantwell
committed
Added deployment section
Added deployment section
1 parent 413c1a3 commit b175412

File tree

20 files changed

+186
-28
lines changed

20 files changed

+186
-28
lines changed

.DS_Store

0 Bytes
Binary file not shown.

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,17 @@ Today we are going to learn how to make your own machine learning program so tha
1919
* Understand how machine learning and the cloud can be used in the future
2020

2121
[Puppy (and Kitten) Vision AWS Educate Workshop](https://aws-educate.jacobcantwell.com/)
22+
23+
## Deploying
24+
25+
### Hugo
26+
27+
Install hugo.
28+
29+
Run with
30+
31+
```bash
32+
hugo serve
33+
```
34+
35+
Preview website at localhost:1313

content/.DS_Store

0 Bytes
Binary file not shown.

content/10_aws_educate/_index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ In order to complete the Puppy Challenge you will need to create an AWS Educate
1818

1919
You are ready to get started on the *Puppy Challenge*!
2020

21-
To complete the challenges, we need to complete the following steps on the AWS Management Console. The AWS Management Console is where we can access all of our services such as Lex, which is used to power our AI assistant Alexa. Think of the console as the homepage of AWS.
21+
To complete the challenges, we need to complete the following steps on the AWS Management Console. The AWS Management Console is where we can access all of our services such as Lex, which is used to power our AI assistant Alexa.
2222

2323
![Dog talking to an Alexa enabled Amazon Echo device](../20_puppy_vision/images/puppy-vision-04.jpg "Dog talking to an Alexa enabled Amazon Echo device")

content/20_puppy_vision/.DS_Store

4 KB
Binary file not shown.

content/20_puppy_vision/20_custom_labels/_index.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ chapter = true
44
weight = 20
55
+++
66

7-
## Custom labels
7+
## Amazon Rekognition Custom Labels
8+
9+
Amazon Rekognition Custom Labels is a feature of Amazon Rekognition that enables customers to build their own specialized machine learning (ML) based image analysis capabilities to detect unique objects and scenes integral to their specific use case.
10+
11+
Instead of having to train a model from scratch, which requires specialized machine learning expertise and millions of high-quality labeled images, customers can use Amazon Rekognition Custom Labels to achieve state-of-the-art performance for their unique image analysis needs.
12+
13+
### Get started
814

915
Let’s get started building a model that can detect puppies.
1016

@@ -16,12 +22,16 @@ Let’s get started building a model that can detect puppies.
1622
![Choose Get Started](20_custom_labels/images/create-project-03.jpg "Choose Get Started")
1723
4. You might see a *First time set up* popup window. Amazon Rekognition requires an S3 bucket to store your project files. Choose **Create S3 bucket**.
1824
![Create S3 bucket](20_custom_labels/images/create-project-04.jpg "Create S3 bucket")
19-
5. To start the project, we need to give it a name. Type in *PuppyChallenge*.
25+
6. Select *Projects*, in the left menu.
26+
7. Select *Create Project*
27+
8. To start the project, we need to give it a name. Type in *PuppyChallenge*.
2028
```bash
2129
PuppyChallenge
2230
```
2331
![Enter project name](20_custom_labels/images/create-project-05.jpg "Enter project name")
2432
1. Choose **Create project**.
2533
![Choose Create project](20_custom_labels/images/create-project-06.jpg "Choose Create project")
34+
2. Select *Projects*, in the left menu.
35+
3. Select your *PuppyChallenge* project.
2636

2737
We are now ready to move on to the next stage of the Puppy Challenge.

content/20_puppy_vision/30_dataset/_index.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,21 @@ Make sure to save all pictures to your desktop.
3030
1. If you are in the *Amazon Rekognition Custom Labels* Projects page, choose **PuppyChallenge**
3131
2. We need to start by creating the data set. Choose **Create dataset** to begin.
3232
![Create data set](30_dataset/images/create-dataset-01.jpg "Create data set")
33-
3. Like when you have a puppy, it is also important to name our data set. Type in *PuppyPhoto* into the data set name box.
33+
3. Like when you have a puppy, it is also important to name our data set. Type in *PuppyPhotos* into the data set name box.
3434
```bash
35-
PuppyPhoto
35+
PuppyPhotos
3636
```
3737
![Create data set](30_dataset/images/create-dataset-02.jpg "Create data set")
3838
3. We need to upload the pictures you found earlier to the data set! Choose **Upload images from your computer**.
3939
![Upload images from your computer](30_dataset/images/create-dataset-03.jpg "Upload images from your computer")
40-
4. A Tool guide popup may appear the first time you create a dataset. Choose **Next** until the popup closes.
41-
5. Choose **+ Add images**
42-
6. To add photos into the dataset, you can either drag your photos from the desktop into the data set or click **Choose files** and select your puppy photos from the desktop.
40+
4. Choose *Submit*
41+
5. A Tool guide popup may appear the first time you create a dataset. Choose **Next** until the popup closes.
42+
6. Choose **+ Add images**
43+
7. To add photos into the dataset, you can either drag your photos from the desktop into the data set or click **Choose files** and select your puppy photos from the desktop.
4344
![Choose files](30_dataset/images/create-dataset-04.jpg "Choose files")
44-
7. You might get an error because your photos are too large or a problem with the filename. If you have problems, **try uploading one image at a time.** Images must be less than 4096 pixels and greater than 64 pixels. Try a smaller image if you have problems uploading larger images. Or **[Download a collection of photos of puppies from Pexel](images/puppies.zip)**
45-
8. Choose **Upload images**.
46-
9. Choose **Submit**.
45+
8. *You can add 30 images this way at a time.*
46+
9. You might get an error because your photos are too large or a problem with the filename. If you have problems, **try uploading one image at a time.** Images must be less than 4096 pixels and greater than 64 pixels. Try a smaller image if you have problems uploading larger images. Or **[Download a collection of photos of puppies from Pexel](images/puppies.zip)**
47+
10. Choose **Upload images**.
48+
11. Choose **Submit**.
4749

4850
In the next step, we will start labelling our photos.

content/20_puppy_vision/40_labelling/_index.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ You tell Amazon Rekognition what it needs to learn by creating labels in each ph
1212

1313
1. We need to create a label. Choose **Add labels** and a popup window will appear.
1414
![Add labels](40_labelling/images/labelling-01.jpg "Add labels")
15-
2. Choose **Add labels** and type in *Puppies*.
15+
2. Choose **Add labels** and type in *Puppy*.
1616
```bash
17-
Puppies
17+
Puppy
1818
```
1919
3. When you are done choose **Add label**.
2020
4. Choose **Save**.
21-
![Add Puppies label](40_labelling/images/labelling-02.jpg "Add Puppies label")
21+
![Add Puppies label](40_labelling/images/labelling-02.jpg "Add Puppy label")
2222

23-
You should see a *Puppies* label appear in the *Filter by labels* section.
23+
You should see a *Puppy* label appear in the *Filter by labels* section.
2424

2525
## Assign labels
2626

content/20_puppy_vision/50_training/_index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ As part of model training, Amazon Rekognition Custom Labels requires a labeled t
1414

1515
If you are still in your *PuppyChallenge* project page:
1616

17-
1. Choose **Train model**.
17+
1. Choose **Train new model**.
1818

1919
If you are back on the *Amazon Rekognition Custom Labels* page,
2020

@@ -23,7 +23,7 @@ If you are back on the *Amazon Rekognition Custom Labels* page,
2323
3. Choose **Train new model**.
2424
![Train new model](50_training/images/training-01.jpg "Train new model")
2525
4. For *Choose project*, choose your **PuppyChallenge** project.
26-
5. For *Choose training dataset*, choose your **PuppyPhoto** dataset.
26+
5. For *Choose training dataset*, choose your **PuppyPhotos** dataset.
2727
6. For *Create test set*, choose **Split training dataset**.
2828

2929
With a *Split training dataset*, Amazon Rekognition will hold back 20% of the images for testing and use the remaining 80% of the images to train the model.
0 Bytes
Binary file not shown.

content/20_puppy_vision/70_testing/_index.md

+24-7
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ There are some costs to training and running the model. [Amazon Rekognition Cust
2626

2727
#### Amazon Rekognition Custom Labels Demo
2828

29-
There is also a demonstration web application that you can deploy to view your model in a web application. [Amazon Rekognition Custom Labels Demo](https://github.com/aws-samples/amazon-rekognition-custom-labels-demo)
30-
31-
Deploying the web application will be part of our next workshop and for now we will test a trained model that we started earlier.
29+
Deploying the web application will be part of our next step and for now we will test a trained model that we deployed earlier.
3230

3331
{{% notice info %}}
3432
You have done all of the hardwork creating a dataset, labelling your data, training a model, and evaluating the model results. Post in the chat how you would use your own custom label model in your own software.
@@ -38,14 +36,14 @@ You have done all of the hardwork creating a dataset, labelling your data, train
3836

3937
We have deployed a puppy model using the instructions above and deployed it with a *Amazon Rekognition Custom Labels Demo* web application above.
4038

41-
1. Open a new web browser tab and go to **https://viewer-aws-educate.jacobcantwell.com/**
39+
1. Open a new web browser tab and go to **https://dwizm1fya2bik.cloudfront.net/**
4240
2. Login with the username **puppy2**
4341
```bash
4442
puppy2
4543
```
4644
3. Use password **puppy2#**
4745
```bash
48-
puppy2#
46+
puppy2$
4947
```
5048
4. Choose the **PuppyChallenge.2021-##-##T##.##.##** model
5149
5. Upload an image of a puppy.
@@ -55,8 +53,27 @@ puppy2#
5553

5654
You can see the *Results* from the train model output. The labels and confidence scores are listed and this web application draws a box around any puppies it has detected.
5755

56+
Look at the response to see the label applied to your image.
57+
58+
```json
59+
{
60+
"CustomLabels": [
61+
{
62+
"Confidence": 83.60199737548828,
63+
"Geometry": {
64+
"BoundingBox": {
65+
"Height": 0.6938999891281128,
66+
"Left": 0.2750700116157532,
67+
"Top": 0.23050999641418457,
68+
"Width": 0.4900299906730652
69+
}
70+
},
71+
"Name": "Puppy"
72+
}
73+
]
74+
}
75+
```
76+
5877
{{% notice info %}}
5978
Post in the chat if the model detected your puppy image.
6079
{{% /notice %}}
61-
62-
Next step is the conclusion.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
+++
2+
title = "Deploying"
3+
chapter = true
4+
weight = 75
5+
+++
6+
7+
## Deploying the model
8+
9+
You trained model is now ready to integrate into a website, software applications, mobile phone apps, any way that you think you can use it.
10+
11+
We will deploy a demonstration web application that you can use to test Custom Labels with models trained by Amazon Rekognition.
12+
13+
### Architecture
14+
15+
The Custom Labels Demo uses [Amazon Rekognition](https://aws.amazon.com/rekognition) for label recognition, [Amazon Cognito](https://aws.amazon.com/cognito) for authenticating the Service Requests, and [Amazon CloudFront](https://aws.amazon.com/cloudfront), [Amazon S3](https://aws.amazon.com/s3), [AWS Amplify](https://aws.amazon.com/amplify), and [React](https://reactjs.org) for the front-end layer.
16+
17+
![Architecture Diagram](75_deploying/images/amazon-rekognition-1.png)
18+
19+
When accessing the Demo, the frontend app calls the `DescribeProjects` action in Amazon Rekognition. Then, for each project, it calls the `DescribeProjectVersions` action. This is for fetching the list and status of each model in the current account.
20+
21+
In addition to showing all the models, the UI allows to start all the models in the *TRAINING_COMPLETED* or *STOPPED* state by calling the `StartProjectVersion` action.
22+
The UI also allows to stop a model in the *RUNNING* state by calling the `StopProjectVersion` action.
23+
24+
If you have any model in the *RUNNING* state, you can click the title and then select an image from your local machine to detect custom labels. The frontend app will call the `DetectCustomLabels` action in Amazon Rekognition.
25+
26+
To learn more about Custom Labels [consult the documentation](https://docs.aws.amazon.com/rekognition/latest/customlabels-dg/what-is.html).
27+
28+
### Usage
29+
30+
#### Prerequisites
31+
32+
Your access to the AWS account must have IAM permissions to launch AWS CloudFormation templates that create IAM roles.
33+
34+
#### Deployment
35+
36+
The demo application is deployed as an [AWS CloudFormation](https://aws.amazon.com/cloudformation) template.
37+
38+
> **Note**
39+
40+
You are responsible for the cost of the AWS services used while running this sample deployment. There is no additional cost for using this sample. For full details, see the following pricing pages for each AWS service you will be using in this sample. Prices are subject to change.
41+
42+
> * [Amazon Rekognition Pricing](https://aws.amazon.com/rekognition/pricing/)
43+
> * [Amazon S3 Pricing](https://aws.amazon.com/s3/pricing/)
44+
> * [Amazon Cognito Pricing](https://aws.amazon.com/cognito/pricing/)
45+
> * [Amazon CloudFront Pricing](https://aws.amazon.com/cloudfront/pricing/)
46+
47+
1. Deploy the latest CloudFormation template by following the link below for your preferred AWS region:
48+
49+
|Region|Launch Template|
50+
|------|---------------|
51+
|**US East (N. Virginia)** (us-east-1) | [![Launch the CustomLabelsDemo Stack with CloudFormation](75_deploying/images/deploy-to-aws.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=CustomLabelsDemo&templateURL=https://solution-builders-us-east-1.s3.us-east-1.amazonaws.com/amazon-rekognition-custom-labels-demo/latest/template.yaml)|
52+
|**US East (Ohio)** (us-east-2) | [![Launch the CustomLabelsDemo Stack with CloudFormation](75_deploying/images/deploy-to-aws.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-2#/stacks/new?stackName=CustomLabelsDemo&templateURL=https://solution-builders-us-east-2.s3.us-east-2.amazonaws.com/amazon-rekognition-custom-labels-demo/latest/template.yaml)|
53+
|**US West (Oregon)** (us-west-2) | [![Launch the CustomLabelsDemo Stack with CloudFormation](75_deploying/images/deploy-to-aws.png)](https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=CustomLabelsDemo&templateURL=https://solution-builders-us-west-2.s3.us-west-2.amazonaws.com/amazon-rekognition-custom-labels-demo/latest/template.yaml)|
54+
|**EU (Ireland)** (eu-west-1) | [![Launch the CustomLabelsDemo Stack with CloudFormation](75_deploying/images/deploy-to-aws.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-1#/stacks/new?stackName=CustomLabelsDemo&templateURL=https://solution-builders-eu-west-1.s3.eu-west-1.amazonaws.com/amazon-rekognition-custom-labels-demo/latest/template.yaml)|
55+
56+
57+
1. If prompted, login using your AWS account credentials.
58+
59+
2. You should see a screen titled "*Create Stack*" at the "*Specify template*" step. The fields specifying the CloudFormation template are pre-populated. Click the **Next** button at the bottom of the page.
60+
61+
3. On the "*Specify stack details*" screen you may customize the following parameters of the CloudFormation stack:
62+
* **Stack Name:** (Default: *CustomLabelsDemo*) This is the name that is used to refer to this stack in CloudFormation once deployed. The value must be 15 characters or less.
63+
* **AdminEmail:** This is the e-mail address used to create the Admin User in the Cognito User Pool.
64+
* **ResourcePrefix:** (Default: *RekogCustomLabelsDemo*) AWS Resources are named based on the value of this parameter. You must customise this if you are launching more than one instance of the stack within the same account.
65+
* **CreateCloudFrontDistribution** (Default: *true*) Creates a CloudFront distribution for accessing the web interface of the demo. This must be enabled if S3 Block Public Access is enabled at an account level. **Note:** Creating a CloudFront distribution may significantly increase the deploy time (from approximately 5 minutes to over 30 minutes).
66+
67+
When completed, click **Next**
68+
69+
4. [Configure stack options](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-add-tags.html) if desired, then click **Next**.
70+
5. On the review you screen, you must check the boxes for:
71+
72+
* "*I acknowledge that AWS CloudFormation might create IAM resources*"
73+
* "*I acknowledge that AWS CloudFormation might create IAM resources with custom names*"
74+
* "*I acknowledge that AWS CloudFormation might require the following capability: CAPABILITY_AUTO_EXPAND*"
75+
76+
These are required to allow CloudFormation to create the IAM roles specified in the CloudFormation using both fixed and dynamic names.
77+
78+
6. Click **Create Change Set**
79+
7. On the *Change Set* screen, click **Execute** to launch your stack.
80+
* You may need to wait for the *Execution status* of the change set to become "*AVAILABLE*" before the "**Execute**" button becomes available.
81+
82+
8. Wait for the CloudFormation stack to launch. Completion is indicated when the "Stack status" is "*CREATE_COMPLETE*".
83+
* You can monitor the stack creation progress in the "Events" tab.
84+
9. Note the *url* displayed in the *Outputs* tab for the stack. This is used to access the application.
85+
86+
#### Accessing and using the Demo
87+
88+
Once deployed, the application can be accessed using a web browser using the address specified in `url` output from the CloudFormation stack created during [deployment](#deployment) of the solution.
89+
90+
When accessing the application for the first time, you need to use the Admin e-mail provided during Stack Creation as username. A temporary password will be sent to the same e-mail address. After authentication, it will be necessary to create a new password and click "Change".
91+
92+
To manage users, you can use the [Cognito Users Pool console](https://console.aws.amazon.com/cognito/users).
93+
Loading
Loading
Loading
Loading
Loading

content/20_puppy_vision/80_conclusion/_index.md

+20
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,30 @@ weight = 80
66

77
## Conclusion
88

9+
### Removing the demo application
10+
11+
To remove the demo application, open the AWS CloudFormation Console, click the **CustomLabelsDemo** project then right-click and select "*Delete Stack*". Your stack will take some time to be deleted. You can track its progress in the "*Events*" tab. Once the stack deletion is complete, the status will change from "*DELETE_IN_PROGRESS*" to "*DELETE_COMPLETE*". It will then disappear from the list.
12+
### Thank you
13+
914
Thank you all for participating in the Puppy Challenge!
1015

1116
We hope that you enjoyed it and that you now know the skills needed to make your own AWS Rekognition image recognition model.
1217

1318
*What are some models that you would like to train next?*
1419

1520
![Cute puppy in a mug](80_conclusion/images/conclusion-01.jpg "Cute puppy in a mug")
21+
22+
## Feedback
23+
24+
{{% notice info %}}
25+
Your feedback is very important to how we can deliver better workshops to you and other students.
26+
{{% /notice %}}
27+
28+
Please answer these questions for us:
29+
30+
* What did you like about this workshop?
31+
* What did you not like about this workshop?
32+
* What can we improve to make it better?
33+
* What would you like learn about next?
34+
35+
You can answer in the chat or send the answers to your teacher to send to us.

0 commit comments

Comments
 (0)