Automated Deployment - Auto Check-In App

Automated Deployment

Before you launch the automated deployment, please review the architecture, configuration, and other considerations discussed in this guide. Follow the step-by-step instructions in this section to configure and deploy the Auto Check-In App into your account.

Time to deploy: Approximately five minutes

Prerequisites

Before you launch the Auto Check-In App, you must have the AWS Command Line Interface (AWS CLI) version 1.16.243 installed, Python 3.7, and OpenCV 4.1.0.

What We'll Cover

The procedure for deploying this architecture on AWS consists of the following steps. For detailed instructions, follow the links for each step.

Step 1. Launch the Stack

  • Launch the AWS CloudFormation template into your AWS account.

  • Review the template parameters, and adjust if necessary.

Step 2. Upload Images to Amazon S3

  • Upload attendee face images to the solution’s Amazon S3 bucket.

Step 3. Download and Configure the App

  • Download and configure the included UI.

Step 4. Launch and Run the App

  • Take the attendee’s photo and let the solution compare the image to the face collection.

Step 1. Launch the Stack

This automated AWS CloudFormation template deploys the Auto Check-In App in the AWS Cloud. Make sure that you have reviewed the prerequisites and considerations before launching the stack.

Note

You are responsible for the cost of the AWS services used while running this solution. See the Cost section for more details. For full details, see the pricing webpage for each AWS service you will be using in this solution.

  1. Sign in to the AWS Management Console and click the button below to launch the auto-check-in-app AWS CloudFormation template.

    
                                Auto Check-In App launch button

    You can also download the template as a starting point for your own implementation.

  2. The template is launched in the US West (Oregon) Region by default. To launch this solution in a different AWS Region, use the region selector in the console navigation bar.

  3. On the Create stack page, verify that the correct template URL shows in the Amazon S3 URL text box and choose Next.

  4. On the Specify stack details page, assign a name to your solution stack.

  5. Under Parameters, review the parameters for the template, and modify them as necessary. This solution uses the following parameters.

    Parameter Default Description
    Log Level INFO

    Choose a log level for the AWS Lambda functions. Choose CRITICAL, ERROR, WARNING, INFO, DEBUG, or NOSET.

    Registration Bucket Name auto-check-in-app-register

    The name of the Amazon S3 bucket where face images are uploaded and stored during registration.

    Rekognition Collection Name auto-check-in-app-face-collection

    The name of the Amazon Rekognition face collection.

    Rekognition Face Similarity Threshold 99

    Specify a value between 0 and 100 that determines how similar the captured face image must be to the pre-registered face image.

  6. Choose Next.

  7. On the Configure stack options page, choose Next.

  8. On the Review page, review and confirm the settings. Be sure to check the box acknowledging that the template will create AWS Identity and Access Management (IAM) resources.

  9. Choose Create stack to deploy the stack.

    You can view the status of the stack in the AWS CloudFormation console in the Status column. You should see a status of CREATE_COMPLETE in approximately five minutes.

Note

In addition to the primary AWS Lambda function, this solution includes the auto-check-in-app-CreateCollection Lambda function, which runs only during initial configuration or when resources are updated or deleted.

When running this solution, the auto-check-in-app-CreateCollection function is inactive. However, do not delete the function as it is necessary to manage associated resources.

Step 2. Upload Images to Amazon S3

Note

We recommend testing the solution before your event.

Before you start uploading images to the solution’s Amazon Simple Storage Service (Amazon S3) bucket, make sure you review the image preparation guidelines.

You can use any tool to upload the images to the solution-created Amazon S3 bucket for registration photos. If you used the default setting, the bucket name is auto-check-in-app-register-<region>-<account-id>. If you changed the default name, you can find the bucket name in the stack Outputs tab. The bucket name is the value of RegistrationBucketName key.

After you successfully upload a photo, the facial features are automatically extracted into a feature vector and added to the Amazon Rekognition face collection. After the vector is added, the original photo is automatically deleted from the Amazon S3 bucket.

Step 3. Download and Configure the App

Use this procedure to download and configure the included UI.

  1. On the laptop you will use during your event, run the following command in your preferred directory to clone the application source code from GitHub.

    $ git clone https://github.com/awslabs/auto-check-in-app.git
  2. After the code is cloned, navigate to the auto-check-in-app/source/frontend directory.

  3. Run the following command.

    chmod +x register-operator.sh
  4. Run the following command.

    ./register-operator.sh <operator E-mail address>
    Note

    Specify the applicable AWS Region and AWS CloudFormation stack name in the script.

  5. Enter a password.

  6. Open the default.env.json file and copy it to env.json.

  7. Modify the file with the applicable values.

    Note

    You can find the applicable values in the stack Outputs tab.

    The following table shows the applicable output keys and values.

    Key Value Description
    Region us-west-2 The AWS Region where you launched the stack.
    API Endpoint <rest-api-id>.execute-api.us-west-2.amazonaws.com/prod/recognize_face The Amazon API Gateway endpoint name with the REST API ID.
    Cognito User Pool ID <region>_<ID> The Cognito user pool ID.
    Cognito User Pool Client ID <client ID> The Cognito user pool client ID.

Step 4. Launch and Run the App

Use this procedure to launch the Auto Check-In App and start comparing faces.

  1. To launch the check-in app, run the following command.

    $ python main.py
  2. When prompted, enter your user name and password.

  3. Use a built-in camera or a USB camera to take a picture of the attendee’s face. While the image is being processed, the status will change from Stop here (no face is detected) to Checking (the face is detected and being compared to the face collection) to Welcome (a face is found with high similarity).

    Note

    After the status changes to Welcome, it will change back to Checking for 10 seconds, by default, to avoid recurrent acceptance signals. To change the amount of time, modify the VisibilityTimeout parameter in the env.json file.

After the image is taken, a window opens to show the face detection and recognition results.

{'result': 'OK', 'name': '<username>', 'similarity': 99.71908569335938} {'result': 'OK', 'name': '<username>', 'similarity': 99.79707336425781} {'result': 'OK', 'name': '<username>', 'similarity': 99.7418441772461}