Photo Search on AWS

The Photo Search on AWS guidance leverages Amazon Rekognition's artificial intelligence (AI) and machine learning (ML) capabilities to search through your library of images and help find the right photos efficiently. The guidance allows you to find a right match for a celebrity, politician, CEO, or a field expert from your large library of photographs for immediate use in relation to a newsworthy event.


Robust photo registration and search capability

Catalog millions of photos with the robust registration method and locate photos containing distinctive human faces using Amazon Rekognition.

Simple user interface actions

Use the simple static web user interface (UI) hosted in an Amazon S3 bucket to upload (register) and search photos.

Multiple search options

Search similar photos by uploading another photo with a face as the search input, or by name or tags assigned to photos.


The diagram below presents the architecture you can build using the example code on GitHub.

Photo Search on AWS guidance architecture

1. An Amazon CloudFront distribution to provide the solution's front-end web UI.

2. An AWS Lambda function called through the Amazon API Gateway returns pre-signed URLs. All following requests to the Amazon API Gateway are authorized by Amazon Cognito.

3. An Amazon S3 bucket for storing your image library. Use the pre-signed URLs to upload images to the library.

4. Uploading an image to Amazon S3 invokes an AWS Lambda function. The AWS Lambda function stores the metadata to Amazon OpenSearch Service, and registers the image to Amazon Rekognition using the IndexFaces API.

5. An AWS Lambda function to assign name to images. An AWS Lambda function to add tags to images.

6. An AWS Lambda function to search the catalog of images against a similar face. It returns dimensions of faces which are detected in the image using the DetectFaces API.

7. An AWS Lambda function which uses the SearchFacesByImage API to find images with faces similar to the one in the image specified by the user. The function returns the images’ URLs on Amazon S3. 

8. An AWS Lambda function to search for images using name or tags. The function returns the images' URLs on Amazon S3 after it searches the URLs using Amazon OpenSearch Service.

Photo Search on AWS

Version 1.0.0
Released: 1/2022
Author: AWS

Additional resources

Did this Guidance help you?
Provide feedback 
Build icon
Deploy an AWS Solution yourself

Browse our library of AWS Solutions to get answers to common architectural problems.

Learn more 
Find an APN partner
Find an AWS Partner Solution

Find AWS Partners to help you get started.

Explore icon
Explore Guidance

Find prescriptive architectural diagrams, sample code, and technical content for common use cases.

Learn more