{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Authentication Use Case (1:n Identification)\n", "-----\n", "\n", "Here we are going to take a look at the Authentication use case. Here we simply ask a user to snap a selfie the system will then compare the selfie to registered users. The following diagram details the process. \n", "\n", "\n", "\n", "\n", "\n", "1. user initiates an authentication to an application \n", "2. user snaps a selfie which will be used to compare to the drivers license\n", "3. system makes image quality checks\n", "4. 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", " " ] }, { "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))" ] }, { "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": [ "## Setup Collection and Index Faces\n", "\n", "\n", "-----\n", "\n", "Here we'll create a collection and index faces from our image mapping file into a panda's dataframe\n", "\n", "