Coder Social home page Coder Social logo

yourtechmafia / aws-rekognition-identity-verification Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws-samples/rekognition-identity-verification

0.0 0.0 0.0 1.29 MB

Example implementation of the Identity Verification using Amazon Rekognition whitepaper.

License: MIT No Attribution

Shell 9.63% JavaScript 19.19% Python 65.87% CSS 0.34% HTML 0.67% Batchfile 0.33% Dockerfile 3.97%

aws-rekognition-identity-verification's Introduction

Amazon Rekognition Identity Verification (RIV)

A solution to assist with identity verification using Amazon Rekognition.

Prerequisites

There are two personas that will need to deploy the Rekognition Identity Verification sample. First, is operational teams that want to use the official artifacts. These users can leverage the Launch Template button to deploy the topology into their account. This audience does not need to worry about additional prerequisite or deployment steps. In contrast, the second persona is development teams that must customize the solution. These users can either use the Docker-based build terminal or locally install on their workstation.

The Docker-based build terminal provides a consistent experience across Microsoft Windows, Apple OSX, and Linux environments. There are two scripts, available named ship-it and debug. Invoking ship-it will create the Docker-based deployment process, push the local code into AWS, and then exit. Alternatively, debug creates a long running terminal session that’s suited for hands-on-keyboard situations.

# Setup the AWS CLI
aws configure                                                                     
                                                                                  
# Launch the Windows-specific script                                              
c:\git\rekoginition-identity-verification\docker-deploy\debug.bat                 
                                                                                  
# Launch the Linux-specific script                                                
~/git/rekoginition-identity-verification/docker-deploy/debug.sh                   

Locally installing on a workstation requires the following steps. The specific commands can be found within the cdk-deploy/Dockerfile (https://github.com/aws-samples/rekognition-identity-verification/blob/main/images/cdk-deploy/Dockerfile). Using this approach simplifies specific debugging scenarios, and is recommended for more sophisticated development scenarios.

  1. Locally install AWS CDK as the official documentation describes.
  2. Bootstrap CDK for AWS Account
  3. Install Python >=3.6 from python.org
  4. Install the additional dependencies using: pip3 install -r requirements.txt

Option: Local Install: Debian (Bullseye), Ubuntu (Focal), OSX (Catalina), and Amazon Linux 2 users can run the one-click.sh script to synthesize the OneClickTemplate.template.json for Amazon CloudFormation and deploy the supporting Lambda functions. The script will also install any missing dependencies on the local box.

Option: Docker: The solution comes with Docker-Enabled Deployment Scripts that will provide a consistent experience without cluttering your workstation. This route will is geared toward developers and power users specifically.

Note: Developers must configure and install the AWS CLI before using either path. This requirement comes from both install solutions relying on the ~/.aws/credentials to access cloud resources.

Solution Deployment

The one-click.sh utility script is the recommended procedure for deploying a RIV stack into an AWS Account. It automates every step including installing missing dependency and executing all Out-Of-Band (OOB) operations. Additionally, there is support for upgrading existing environments and seamlessly handling any future requirements. The script relies on environment variables to control its behavior. Customers can either explicitly define these values or rely on its discovery mechanisms.

# Run the script                                                                  
./one-click.sh  my-unique-bucket-name                                             

This table enumerates the overridable environment variables. The deployment script supports deploying multiple stacks within the same account and region (e.g., Prod and Dev in us-east-1). Additionally, the default settings support 200M unique faces. Please contact us at [email protected] for instructions beyond this threshold. Lastly, AWS CloudFormation requires the Amazon S3 bucket and deployment region are the same. When these values differ the create-stack command fails with a descriptive error.

# Create a bucket in your desired region.
# If the specified bucket does not exist, it will be created.
# Note: Bucket name cannot contain dots (.)
export AWS_REGION=us-east-1
export BUCKET_NAME=my-unique-bucket-name

# Customers can deploy multiple instances to the same region (Prod vs Dev)
# If this value is not set then it defaults to 'Riv-Prod'
# You control this functionality by setting the Landing Zone Name value
export RIV_STACK_NAME=Riv-Prod

# Running this command will install any dependencies (brew, yum, or apt required)
# After preparing the local machine it will synthesize and deploy into your environment.
TOTAL_COLLECTIONS=1 ./one-click.sh $BUCKET_NAME
Name Default Description
TOTAL_COLLECTIONS 1 Total Rekognition Collections to Create (1=20M faces)
RIV_STACK_NAME Riv-Prod The stack name
S3_ASSET_BUCKET Argument The Amazon S3 Bucket to stage deployment artifacts
S3_REGION Discovered The Region hosting the S3_ASSET_BUCKET

How do I run the amplify app locally

#First create a .env.local file in the frontend directory with the following contents:

REACT_APP_ENV_API_URL=https://YOUR_API_GW_STAGE_URL

#Install depedency and start the app

npm install
npm start

How is the code organized

  • images. Contains any docker definitions to deploy the solution
  • infra. CDK Automation for provisioning the environment(s)
    • bulkloader. The RIV bulk importing service.
    • services. Standard AWS supporting components (e.g., backup)
    • storage. Defines all shared data stores.
    • userportal. The public interface that endusers interact with
  • src. The backing code for Lambdas functions and other compute constructs
    • rekognition. Step function tasks for interacting with Amazon Rekognition
    • bulk-loader. Imports a source bucket into the RIV service
    • test-client. A command line interface for interacting with the RIV service.
    • textract. Step function tasks for interacting with Amazon Textract
    • frontend. React Frontend Web App for Indentificaton Verification

How do I get intellisence in Microsoft Visual Studio Code

  1. Run pip3 install -r images/cdk-deploy/requirements.txt
  2. Close and reopen the project e.g., code /git/amazon-rekognition-identity-verification

aws-rekognition-identity-verification's People

Contributors

amazon-auto avatar dependabot[bot] avatar dr-natetorious avatar vineetkachhawaha avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.