Overview
AWS Rekognition is a cloud-based computer vision service offered by Amazon Web Services. It provides pre-trained deep learning models to perform various image and video analysis tasks without requiring machine learning expertise from the developer. Launched in 2016, Rekognition is designed to integrate with other AWS services, enabling scalable solutions for media processing and content management.
The service offers capabilities for identifying objects, scenes, and activities in images and stored videos. It can detect faces, analyze attributes (such as emotions or specific facial features), and compare faces for verification or search purposes. For content moderation, Rekognition can identify potentially unsafe or inappropriate content across various categories, assisting in automated content filtering. Its text detection feature allows for extraction of text from images, which can be useful for indexing or data entry tasks.
A notable feature is Rekognition Custom Labels, which allows users to train custom object detection models with minimal training data. This capability extends the service beyond its pre-trained models, enabling specialized recognition tasks tailored to specific business needs, such as identifying unique product logos or manufacturing defects. Developers using Rekognition benefit from its pay-as-you-go pricing model and compliance certifications, which support regulated industries and data privacy requirements.
Rekognition is often utilized by developers and technical buyers who require automated, scalable computer vision solutions for tasks such as user identity verification, digital asset management, public safety applications, and media analysis. Its comprehensive set of APIs and SDKs facilitates integration into existing applications and workflows, making it a suitable choice for organizations already operating within the AWS ecosystem or those seeking a managed computer vision service.
Key features
- Image Analysis: Detects objects, scenes, and activities in images. It also supports celebrity recognition and unsafe content detection in still images.
- Video Analysis: Processes stored or streaming video for object, scene, and activity detection, as well as pathing of objects, and celebrity recognition.
- Content Moderation: Automatically identifies and flags potentially inappropriate, offensive, or unsafe content in images and videos, categorized for nuanced review.
- Custom Labels: Allows users to train custom computer vision models to detect specific objects, brands, or concepts in images that are unique to their business, using a small dataset.
- Face Analysis: Detects faces in images and videos, analyzes attributes like age range, emotions, and facial landmarks.
- Face Recognition and Verification: Compares faces in images and videos to a collection of known faces, enabling identity verification and facial search functionalities.
- Text in Image: Extracts text from images, suitable for tasks such as license plate recognition, street sign reading, or data extraction from documents.
Pricing
AWS Rekognition operates on a pay-as-you-go model with tiered pricing based on the specific features used and the volume of usage. A free tier is available for initial exploration and low-volume use cases.
| Feature Category | Free Tier (per month) | Starting Paid Tier (per unit) | Notes |
|---|---|---|---|
| Image Analysis | 5,000 images | $0.001 per image | For object, scene, face, and content moderation analysis. |
| Video Analysis | 1,000 minutes | $0.01 per minute | For object, scene, face, and content moderation analysis in video. |
| Face Recognition Storage | 1,000 face metadata units | $0.00001 per face metadata unit | For storing face vectors in a collection for search/verification. |
| Custom Labels Training | 10 training hours | $3.00 per hour | Cost for training custom models. |
| Custom Labels Inference | — | $0.001 per image | Cost for using trained custom models for predictions. |
Common integrations
- Amazon S3: For storing images and videos that Rekognition processes. Refer to the Rekognition S3 integration guide.
- AWS Lambda: To trigger Rekognition analysis upon media uploads or other events, enabling serverless workflows.
- Amazon Kinesis Video Streams: For real-time video analysis with Rekognition Video. The Kinesis Video Streams integration documentation provides details.
- Amazon DynamoDB: To store metadata and results from Rekognition analysis.
- AWS Boto3 (Python SDK): The primary client library for interacting with AWS services, including Rekognition, from Python applications. Information on using the AWS SDKs with Rekognition is available.
Alternatives
- Google Cloud Vision AI: Offers pre-trained models for image analysis, including object detection, face detection, and text recognition, with an emphasis on Google Cloud integration.
- Microsoft Azure Computer Vision: Provides AI services for analyzing visual content, detecting objects, faces, and text, and generating image descriptions within the Azure ecosystem.
- Clarifai: A full-stack AI platform offering pre-built and custom computer vision models for image and video recognition, supporting various industries and use cases.
Getting started
To get started with AWS Rekognition using the Boto3 Python SDK, you can install the SDK and then use the client to call the desired Rekognition APIs. The following example demonstrates how to detect labels (objects and scenes) in an image stored in an S3 bucket.
import boto3
def detect_labels_s3(bucket, photo):
client = boto3.client('rekognition')
response = client.detect_labels(
Image={
'S3Object': {
'Bucket': bucket,
'Name': photo,
}
},
MaxLabels=10,
MinConfidence=75
)
print('Detected labels for ' + photo)
for label in response['Labels']:
print(f" Label: {label['Name']}")
print(f" Confidence: {label['Confidence']:.2f}%")
if 'Instances' in label:
for instance in label['Instances']:
print(f" Bounding box: {instance['BoundingBox']}")
print("\n")
return len(response['Labels'])
if __name__ == '__main__':
# Replace with your S3 bucket name and image file name
s3_bucket_name = 'your-rekognition-test-bucket'
image_file_name = 'my-image.jpg'
# Example usage: ensure your S3 bucket and image exist and Rekognition has permissions
# You would typically upload 'my-image.jpg' to 'your-rekognition-test-bucket' first.
# For details on setting up permissions, refer to the AWS Rekognition IAM documentation.
label_count = detect_labels_s3(s3_bucket_name, image_file_name)
print(f"Total labels detected: {label_count}")
This Python code initializes a Rekognition client and calls the detect_labels API to analyze an image specified by its S3 bucket and object key. The results, including detected labels and their confidence scores, are then printed to the console. Before running, ensure that your AWS credentials are configured and that the IAM role associated with your execution environment has permissions to access Rekognition and the specified S3 bucket. More detailed setup instructions are available in the AWS Rekognition Getting Started Guide.