{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Onboarding Use Case (1:1 Verification)\n", "-----\n", "\n", "Here we are going to take a look at the Onboarding case. Here a user is asked to present an image of a trusted identification document, then snap a selfie image. The following diagram details the process. \n", "\n", "\n", "\n", "\n", "\n", "\n", "1. user presents an image of an identification document like a drivers license or passport\n", "2. user snaps a selfie which will be used to compare to the drivers license\n", "3. system detects a face in the identification document and performs quality checks \n", "4. system detects a face in the selfie and performs quality checks\n", "5. system compares the identification image to the selfie image \n", " - if the similarity is above the specified threshold then we say that the faces match \n", " - if the similarity is below the specified threshold then we say that the faces DON'T match\n", "6. system checks selfie against known onboarded users and fraudsters. \n", "7. indexes the user and the user is onboarded. \n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import io\n", "import boto3\n", "import json\n", "from IPython.display import Image as IImage\n", "import pandas as pd\n", "\n", "%store -r bucket_name\n", "mySession = boto3.session.Session()\n", "aws_region = mySession.region_name\n", "print(\"AWS Region: {}\".format(aws_region))\n", "print(\"AWS Bucket: {}\".format(bucket_name))\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Setup Clients \n", "-----\n", "Here we are going to use both S3 and Rekognition apis " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "s3_client = boto3.client('s3')\n", "rek_client = boto3.client('rekognition')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Step 0. Setup collections \n", "-----\n", "Here we will setup two collections \"registered-users\" and \"fraudulent-users\". The collections will be used to ensure that the user hasn't previously registered and that the user is not a known fraudster. Here we'll quickly create the two collections and index a handful of images. \n", "\n", "