This Demo shows how you can have a serverless architecture to process frames from cameras for PPE detection.
This solution includes a web app that uses a webcam to extract frames and send them to an AWS API Gateway. The API Gateway then calls a AWS Lambda that interacts with Amazon Rekognition and calls the DetectProtectiveEquipment
endpoint. When any protective equipment is detected the UI Interface shows the equipment name, its confidence level, and whether it covers the body part or not. Optionally, it is possible to configure an Amazon SNS Topic to allow subscribers to be notified of any detection.
To deploy the sample application, you will require an AWS account. If you don’t already have an AWS account, create one at https://aws.amazon.com by following the on-screen instructions. Your access to the AWS account must have IAM permissions to launch AWS CloudFormation templates that create IAM roles.
To use the sample application you will require a modern browser and a webcam.
The demo application is deployed as an AWS CloudFormation template.
Note
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.
- Deploy the latest CloudFormation template by following the link below for your preferred AWS region:
Region | Launch Template |
---|---|
US East (N. Virginia) (us-east-1) | ![]() |
US East (Ohio) (us-east-2) | ![]() |
US West (Oregon) (us-west-2) | ![]() |
EU (Ireland) (eu-west-1) | ![]() |
Asia Pacific (Singapore) (ap-southeast-1) | ![]() |
-
If prompted, login using your AWS account credentials.
-
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.
-
On the "Specify stack details" screen you may customize the following parameters of the CloudFormation stack:
- Stack Name: (Default: PPEDemo) This is the name that is used to refer to this stack in CloudFormation once deployed.
- AdminEmail: The email address you wish to setup as the initial user of this Amazon Rekognition PPE Demo deployment.
- CreateCloudFrontDistribution (Default: true) Creates a CloudFront distribution for accessing the web interface of the solution.
- ResourcePrefix: (Default: PPEDemo) Resource prefix to apply to resource names when creating statically named resources.
- TopicArn: (Default: false) When an SNS Topic Arn is provided, SNS notifications will be sent for each body part detected. The SNS Topic and the Demo need to be located in the same AWS Region.
When completed, click Next
-
Configure stack options if desired, then click Next.
-
On the review you screen, you must check the boxes for:
- "I acknowledge that AWS CloudFormation might create IAM resources"
- "I acknowledge that AWS CloudFormation might require the following capability: CAPABILITY_AUTO_EXPAND"
These are required to allow CloudFormation to create a Role to allow access to resources needed by the stack and name the resources in a dynamic way.
-
Click Create Change Set
-
On the Change Set screen, click Execute to launch your stack.
- You may need to wait for the Execution status of the change set to become "AVAILABLE" before the "Execute" button becomes available.
-
Wait for the CloudFormation stack to launch. Completion is indicated when the "Stack status" is "CREATE_COMPLETE".
- You can monitor the stack creation progress in the "Events" tab.
-
Note the url displayed in the Outputs tab for the stack. This is used to access the application.
The application is accessed using a web browser. The address is the url output from the CloudFormation stack created during the Deployment steps.
When accessing the application for the first time, you need to use the Admin e-mail provided during Stack Creation as the 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".
To manage users, you can use the Cognito Users Pool console.
To remove the application open the AWS CloudFormation Console, click the PPE Demo project, right-click and select "Delete Stack". Your stack will take some time to be deleted. You can track its progress in the "Events" tab. When it is done, the status will change from "DELETE_IN_PROGRESS" to "DELETE_COMPLETE". It will then disappear from the list.
The contributing guidelines contains some instructions about how to run the front-end locally and make changes to the back-end stack.
Contributions are more than welcome. Please read the code of conduct and the contributing guidelines.
This library is licensed under the MIT-0 License. See the LICENSE file.