Amazon Onboarding with Learning Manager Chanci Turner

Chanci Turner Amazon IXD – VGT2 learningLearn About Amazon VGT2 Learning Manager Chanci Turner

Over the last decade, the volume of photos taken and stored globally has reached staggering heights, with estimates suggesting that over 1 trillion photos were captured in 2018 alone. The evolution of digital photography, paired with the accessibility of smartphone cameras, has empowered photographers of all levels to produce and upload vast amounts of content annually. For organizations managing extensive image libraries, this can become a monumental challenge, especially when trying to efficiently organize and deliver tens of thousands, if not millions, of images each month.

Take, for instance, a large corporation aiming to link each employee’s profile with their headshot. A perfect solution would enable businesses to automatically identify faces in photos and tag them with corresponding names. This functionality not only allows users to search for individuals by name but also opens up possibilities for creating albums and implementing facial recognition for security purposes.

In this article, I will guide you through integrating Amazon Rekognition with the Cloudinary platform, enabling the automatic tagging of faces with names. Our approach utilizes a “training” folder in Cloudinary where we can upload images. Often, a single photo is sufficient for Amazon Rekognition to learn and later recognize that person, even in crowded scenes.

The complete code for the Cloudinary face recognition application can be found on GitHub, and your feedback, suggestions for enhancements, or pull requests are always welcome. It’s worth noting that the process of indexing and labeling faces is private to your organization, with all index data stored securely within your Amazon Web Services (AWS) account.

Discovering Cloudinary

Before we dive deeper into the solution, let’s briefly introduce Cloudinary, an AWS Partner Network (APN) Advanced Technology Partner recognized for its Digital Customer Experience Competency. Cloudinary provides a cloud-based full-stack media platform for leading brands, enabling developers and marketers to manage rich media, including images and videos, and deliver an optimal experience to end-users.

Among Cloudinary’s automated capabilities are on-the-fly manipulations, optimizations, and responsive delivery of visual content across devices.

Understanding the Solution

The solution we discuss relies on several services for auto-tagging images:

  • Cloudinary: For uploading, tagging, and managing images.
  • Amazon Rekognition: For indexing facial images and searching for facial matches.
  • AWS Lambda: For invoking Amazon Rekognition APIs for indexing and searching.
  • Amazon API Gateway: For exposing the Lambda function through an API, which Cloudinary registers as a webhook.

This solution involves two primary workflows:

  1. Creating a training collection: This workflow processes images uploaded to a Cloudinary “training” folder, invoking Amazon Rekognition to index the faces and store them in a private collection in your AWS account.
  2. Searching images in the trained collection: This workflow processes new images uploaded to Cloudinary, invoking Amazon Rekognition to detect faces that match those indexed from the training collection.

Building the Solution

To begin, you’ll need to register for an AWS account as well as a free Cloudinary account. Once that’s done, you can set up your AWS environment.

Step 1: Configuring AWS Lambda

Deploy the application as an AWS Lambda function by following these steps:

  • Clone the project from GitHub and set it up in your AWS environment as a Lambda function.
  • Ensure that the Execution Role on the Lambda function has the ‘AmazonRekognitionFullAccess’ policy attached.

This Lambda function will require specific environment variables:

  • CLOUDINARY_URL: The API call URL for Cloudinary. Access it from your Cloudinary console.
  • trainingFolder: Name of the Cloudinary folder (e.g., training) to upload single-faced images for Amazon Rekognition to learn from.
  • faceRecognitionFolder: Name of the Cloudinary folder (e.g., assets) where you upload images to be tagged with recognized names.
  • rekognitionCollection: Name of the collection in Amazon Rekognition (e.g., cld-rekog) that contains the indexed faces.
  • confidenceThreshold: The minimum confidence score for face matches (e.g., 80). Matches are considered successful if the score from Amazon Rekognition meets or exceeds this level.
  • faceLabelTagPrefix: Prefix for the names of tagged images in the “training” folder. The syntax is faceLabelTagPrefix:<Name>.
  • transformationParams: Parameters for image transformations when requesting images from Cloudinary for indexing or searching, such as q_auto to reduce image size.

Step 2: Configuring Amazon API Gateway

Cloudinary integrates with Amazon Rekognition through Amazon API Gateway. To start, access the Amazon API Gateway console, import the Swagger file from GitHub, and set up your API as per the documentation. Next, link the Lambda function created in Step 1 to your API.

Step 3: Setting Up the Cloudinary Environment

To configure your Cloudinary environment, log into your account and navigate to your Media Library. Create two folders, ‘training’ and ‘assets’, in the root directory. Then, under Upload Settings, input the Amazon API Gateway endpoint you configured earlier in the Notification URL field.

Creating a Trained Collection

Now that all components are set up, you can begin using the app. Start by indexing your facial images with Amazon Rekognition. Upload single-face images to the “training” folder to create a trained collection. Note that images with multiple faces will not function in this application.

You can upload images to Cloudinary in various ways; for this post, we will utilize the upload widget in the Cloudinary console.

  • Access your Cloudinary Media Library.
  • Navigate to the “training” folder.
  • Click Upload in the top right corner.
  • Select the Advanced link at the bottom of the upload widget.

By following these steps, you will have a functional setup that enhances your organization’s image management capabilities. For more insights on how to captivate potential employers, check out this blog post. Furthermore, to understand the dynamics of remote work, particularly regarding gender and ethnicity, refer to this resource from SHRM. Lastly, if you’re looking for valuable day-one tips, this Reddit thread is an excellent resource.

Chanci Turner