Image Labels Generator with Rekognition
Chain AWS Rekognition and Comprehend to analyze images with AI.
Introduction
30 Second Summary
Every time your phone auto-tags a photo as "Beach" or "Dog", there's an image recognition model working behind the scenes. The same technology powers content moderation, accessibility features, and automated inventory systems.
In this project, you will build a command-line image analysis tool using Python and AWS AI services. You'll upload any image, get back AI-generated labels with confidence scores, then chain those labels into a second AI service for deeper text analysis.
What You'll Build
You run a single Python script, point it at any photo, and watch as AWS AI identifies what's in it and breaks those findings down into structured entities and key phrases.
By the end of this project, you'll have:
- Run a script on any photo and instantly see what Amazon Rekognition detects in it, with confidence percentages for each label.
- Feed those labels through Amazon Comprehend and get back structured entities and key phrases that add meaning to the raw results.
- Show off a professional architecture diagram in draw.io that maps how your Python script, S3, Rekognition, and Comprehend all connect.
- Secret Mission: Batch process an entire folder of images and generate a categorized JSON report ranking the most common labels.
Are there any prerequisites?
You'll need an AWS account with the AWS CLI already installed and configured. Step 1 walks you through installing Python and Boto3 from scratch.
Before We Start
Before we dive in, let's lock in what you're about to build and why it matters.
Taking a moment to commit to the goal helps you stay oriented as you wire up multiple AWS services together.
Set Up Python and Boto3
Your image analysis pipeline talks to AWS through Python code. Without Python and its AWS library installed on your machine, you cannot programmatically call Rekognition or Comprehend.
In this step, you will install Python, create an isolated project environment, and add Boto3 so your scripts can communicate with AWS services.
In this step, get ready to:
- Install Python 3.14.
- Create a project folder with an isolated virtual environment.
- Install the Boto3 library for AWS access.
Install Python 3.14
Python is the programming language your script uses to call AWS services. This project requires version 3.14 or higher.
- Press Cmd+Space (macOS) or the Windows key (Windows) to open your search bar.
- Type Terminal (macOS) or Command Prompt (Windows) and press Enter to open it.
- Check if Python 3.14 is already installed by running this command:
macOS
python3 --version
Windows
python --version
✔️ I see Python 3.14.x
Python 3.14 is ready. Skip ahead to the next substep.
ⓧ I see an older version
Your system has an older Python installed. You need to install version 3.14 alongside it.
- Open https://www.python.org/downloads/ in your browser.
- Click the Download Python 3.14.7 button.
- Run the installer. On Windows, check Add python.exe to PATH before clicking Install Now.
- On macOS, the python.org installer updates python3 to point to the new version. If it does not, use python3.14 as your command instead.
- After installation, close and reopen your terminal, then rerun the version check to confirm you see Python 3.14.7.
ⓧ Command not found
Python is not installed on your machine yet. Let's install it now.
- Open https://www.python.org/downloads/ in your browser.
- Click the Download Python 3.14.7 button.
- Run the installer. On Windows, check Add python.exe to PATH before clicking Install Now.
- On macOS, follow the installer prompts. The default options add Python to your PATH automatically.
- After installation, close and reopen your terminal, then run the version check again to confirm you see Python 3.14.7.
Create your project folder and virtual environment
A virtual environment is an isolated space where Python packages are installed only for this project. It prevents conflicts with packages from other projects on your machine.
- Move to your Desktop by running this command:
cd ~/Desktop
- Create your project folder and move into it by running these commands:
mkdir image-labels-project
cd image-labels-project
- Confirm you are inside the new folder by running:
pwd
You should see a path ending in image-labels-project.
- Create the virtual environment by running this command:
macOS
python3 -m venv .venv
Windows
python -m venv .venv
- Confirm the virtual environment was created by running:
ls -a
You should see .venv listed in the output.
- Activate the virtual environment by running this command:
macOS
source .venv/bin/activate
Windows
.venv\Scripts\activate
Your terminal prompt now shows (.venv) at the beginning. This confirms the virtual environment is active.
Why use a virtual environment?
Without a virtual environment, every Python project on your machine shares the same set of packages. If two projects need different versions of the same library, they conflict.
A virtual environment gives this project its own isolated package space. Once activated, the python and pip commands automatically point to this environment, regardless of your operating system.
Don't see (.venv) in your prompt?
On Windows, you may need to allow script execution first. Run Set-ExecutionPolicy -Scope CurrentUser RemoteSigned in PowerShell, then try the activate command again.
On macOS, make sure you used source before the path. Running the script directly without source does not modify your current shell session.
help me activate my Python virtual environment
Install Boto3
Boto3 is the official AWS SDK for Python. It provides the functions your script calls to interact with Rekognition, Comprehend, and S3.
- Install Boto3 inside your virtual environment by running:
python -m pip install boto3
What does this command do?
The python -m pip install pattern runs pip (the Python package manager) as a module of your active Python interpreter. This guarantees the package lands in the correct virtual environment.
Boto3 brings along its dependencies automatically. You will see several packages downloading and installing.
Before you run the next command, what do you think will happen if Boto3 installed correctly?
- Verify Boto3 is importable by running:
python -c "import boto3; print(boto3.__version__)"
You should see a version number printed, such as 1.43.65. This confirms Boto3 is installed and your Python environment can talk to AWS.
Seeing ModuleNotFoundError?
Make sure your virtual environment is still active. Check that (.venv) appears in your terminal prompt. If it disappeared, reactivate with the activate command from earlier.
If you see a permission error, confirm you are using python -m pip install and not pip install directly.
help me fix a ModuleNotFoundError for boto3 in my virtual environment
Your development environment is locked and loaded. Next up, you will create an S3 bucket and upload an image for Rekognition to analyze.
Create an S3 Bucket and Upload an Image
Your Python environment is set up and Boto3 is ready to talk to AWS.
Amazon Rekognition reads images directly from S3. It cannot access files on your local machine. You need a bucket with an image in it before you can analyze anything.
In this step, get ready to:
- Create an S3 bucket using the AWS CLI.
- Upload a sample image to your bucket.
- Verify the image is accessible in S3.
Create your S3 bucket
S3 bucket names must be globally unique across all AWS accounts. You will include your initials in the name to avoid collisions.
- Create your bucket by running this command:
aws s3 mb s3://[[BUCKET_NAME="image-labels-your-initials-2026"]] --region us-east-1
What does this command do?
- aws s3 mb creates (makes) a new S3 bucket.
- Replace your-initials with your own initials to make the name unique (e.g. image-labels-jk-2026).
- --region us-east-1 places the bucket in the US East (N. Virginia) region, where all three services you will use are available.
You should see a confirmation that looks like make_bucket: s3://image-labels-... in your terminal.
Seeing a BucketAlreadyExists error?
Someone else already owns that bucket name. Add more characters to make it unique (e.g. your full name and a random number).
If you see an access denied error, confirm your AWS CLI credentials have S3 permissions.
Why can't I create my S3 bucket?
Save a sample image in your project folder
You need a photo with clear, recognizable objects so Rekognition returns interesting labels.
- Find any JPEG or PNG photo on your computer with recognizable objects (a street scene, animals, a landscape, or similar).
- Copy or save the image into your image-labels-project folder.
- Rename the file to sample-image.jpg.
No photo handy?
Search the web for a royalty-free image (try searching for "free stock photo street scene" or "free animal photo"). Save any JPEG or PNG that shows multiple objects. The more objects in the photo, the more labels Rekognition will return.
- Confirm the image is in your project folder by running:
ls sample-image.jpg
You should see sample-image.jpg listed in the output.
File not found?
Make sure you are in the image-labels-project folder (run pwd to check). Also confirm the file is named exactly sample-image.jpg with no extra spaces or uppercase letters.
Why can't my terminal find my image file?
Upload your image to S3
With the bucket created and the image saved locally, you can now push the file up to S3 where Rekognition can read it.
- Upload the image by running this command:
aws s3 cp sample-image.jpg s3://[[BUCKET_NAME="image-labels-your-initials-2026"]]/sample-image.jpg
What does this command do?
- aws s3 cp copies a file between your local machine and S3.
- The first argument is your local file path.
- The second argument is the S3 destination in the format s3://bucket-name/key.
You should see output like upload: ./sample-image.jpg to s3://image-labels-... confirming the transfer completed.
Before you run the verification command below, what do you expect to see listed in your bucket?
- Verify the upload by listing your bucket contents:
aws s3 ls s3://[[BUCKET_NAME="image-labels-your-initials-2026"]]/
You should see sample-image.jpg listed with its file size and upload date.
Bucket appears empty?
Double-check that the bucket name in your aws s3 cp command matches the name you used in aws s3 mb. A typo in either command means the upload went to a different bucket (or failed silently).
Also confirm your upload command finished with a success message before running the list command.
Why isn't my image showing up in S3?
Your image is in S3 and ready for analysis. Next up, you will write a Python script that sends this image to Rekognition and gets back AI-generated labels with confidence scores.
Detect Image Labels with Rekognition
Your S3 bucket is loaded with a sample image, ready to be analyzed. Now it's time for the core payoff of this project.
You'll write a Python script that sends your image to Amazon Rekognition, an AWS AI service that looks at a photo and tells you what's in it. One API call returns labels like "Dog", "Beach", "Nature" along with confidence scores showing how certain the AI is about each detection.
In this step, get ready to:
- Create a Python script with imports and AWS configuration.
- Write a function that calls Rekognition's DetectLabels API.
- Run the script and see AI-generated labels with confidence scores.
Create the script with imports and configuration
Rekognition needs to know which S3 bucket and image to analyze. You'll start by creating the script file with the Boto3 import, a Rekognition client, and variables pointing to your bucket and image.
- Create a new file called image_labels.py in your image-labels-project folder and paste the following code:
import boto3
def main():
# AWS region where your S3 bucket and Rekognition run
region = "us-east-1"
# Your S3 bucket name from the previous step
bucket_name = "[[BUCKET_NAME=\"image-labels-your-initials-2026\"]]"
# The image file you uploaded to S3
object_name = "sample-image.jpg"
# Create a Rekognition client to call the API
rekognition_client = boto3.client("rekognition", region_name=region)
print("=" * 60)
print("IMAGE LABELS GENERATOR")
print("=" * 60)
if __name__ == "__main__":
main()
What does this code do?
- boto3.client("rekognition", region_name=region) creates a connection to the Rekognition service in us-east-1.
- bucket_name and object_name tell the script exactly which S3 image to analyze.
- The if __name__ == "__main__" block ensures main() runs only when you execute the file directly.
- Save image_labels.py.
- Run the script to confirm it executes without errors:
python image_labels.py
You should see the header banner printed in your terminal:
============================================================
IMAGE LABELS GENERATOR
============================================================
Seeing a ModuleNotFoundError?
Make sure your virtual environment is active. You should see (.venv) at the start of your terminal prompt.
If not, activate it with . .venv/bin/activate (macOS/Linux) or .venv\Scripts\activate (Windows), then try again.
help me fix a ModuleNotFoundError for boto3 in my image labels script
Write the detect_labels function
Now you'll write the function that actually calls Rekognition. It sends the S3 image reference to the DetectLabels API and gets back a list of detected objects with confidence scores.
- In image_labels.py, add this function above the def main(): line (between the import boto3 line and def main():):
def detect_labels(rekognition_client, bucket_name, object_name):
"""Use Rekognition to detect labels in an image stored in S3."""
response = rekognition_client.detect_labels(
Image={
"S3Object": {
"Bucket": bucket_name,
"Name": object_name,
}
},
MaxLabels=10,
MinConfidence=75,
)
return response["Labels"]
What does this function do?
- rekognition_client.detect_labels() sends a request to the Rekognition API, pointing it at your image in S3.
- MaxLabels=10 limits the results to the top 10 most confident detections.
- MinConfidence=75 filters out anything Rekognition is less than 75% sure about.
- The function returns the Labels array from the response. Each label has a Name (like "Dog") and a Confidence score (like 98.5).
Next, you need to call this function from main() and print the results.
- In the main() function, find the last print("=" * 60) line and add this code below it:
# Detect labels with Rekognition
print("\n--- Detecting labels with Rekognition ---")
labels = detect_labels(rekognition_client, bucket_name, object_name)
print(f"\nDetected {len(labels)} labels:")
for label in labels:
print(f" {label['Name']:20s} Confidence: {label['Confidence']:.1f}%")
What does this code do?
- It calls your detect_labels function, passing the Rekognition client, bucket name, and image key.
- The for loop iterates over each detected label and prints its name (padded to 20 characters for alignment) and confidence percentage.
- Save image_labels.py.
Run the script and observe your labels
Your script is complete. Time to see what AWS AI detects in your image.
- Before you run the script, predict what labels you expect Rekognition to find in your sample image. Think about what objects, scenes, or concepts are visible in the photo you uploaded.
- Run the script:
python image_labels.py
You should see output listing detected labels with confidence scores. For example, a beach photo might produce:
============================================================
IMAGE LABELS GENERATOR
============================================================
--- Detecting labels with Rekognition ---
Detected 8 labels:
Nature Confidence: 99.2%
Outdoors Confidence: 98.7%
Sea Confidence: 96.5%
Water Confidence: 95.1%
Beach Confidence: 93.8%
Sand Confidence: 91.2%
Shoreline Confidence: 88.4%
Coast Confidence: 85.6%
What is a confidence score?
The confidence score (0-100%) represents how certain Rekognition is that the label applies to your image. Higher scores mean the AI is more confident.
Your actual labels will differ based on what's in your specific image. That's the magic of cloud AI. The same code works on any photo.
Getting an AccessDeniedException?
Your AWS CLI credentials need the rekognition:DetectLabels permission. If you're using an admin IAM user (common for learning accounts), this permission is already included.
If you're using a restricted user, add a policy with rekognition:DetectLabels on resource *.
help me fix an AccessDeniedException when calling Rekognition DetectLabels
Getting an InvalidS3ObjectException?
Double-check that your bucket_name and object_name in the script exactly match what you created in the previous step.
Run aws s3 ls s3://your-bucket-name/ to confirm the file name and bucket are correct.
help me fix an InvalidS3ObjectException in my Rekognition script
✔️ Awesome, I've got everything!
Great. Double check you've saved your file.
ⓧ I'd like to double check the full code
Here's the complete image_labels.py so far:
import boto3
def detect_labels(rekognition_client, bucket_name, object_name):
"""Use Rekognition to detect labels in an image stored in S3."""
response = rekognition_client.detect_labels(
Image={
"S3Object": {
"Bucket": bucket_name,
"Name": object_name,
}
},
MaxLabels=10,
MinConfidence=75,
)
return response["Labels"]
def main():
region = "us-east-1"
bucket_name = "[[BUCKET_NAME=\"image-labels-your-initials-2026\"]]"
object_name = "sample-image.jpg"
rekognition_client = boto3.client("rekognition", region_name=region)
print("=" * 60)
print("IMAGE LABELS GENERATOR")
print("=" * 60)
# Detect labels with Rekognition
print("\n--- Detecting labels with Rekognition ---")
labels = detect_labels(rekognition_client, bucket_name, object_name)
print(f"\nDetected {len(labels)} labels:")
for label in labels:
print(f" {label['Name']:20s} Confidence: {label['Confidence']:.1f}%")
if __name__ == "__main__":
main()
You just called a cloud AI service with a few lines of Python. But these labels are just individual words with confidence scores. In the next step, you'll feed them into Comprehend to extract structured entities and key phrases, turning raw labels into richer insights.
Chain Labels into Comprehend for NLP Analysis
In the previous step, you got Rekognition to detect objects and scenes in your image. You have a list of labels like "Dog", "Beach", and "Ocean" printed with confidence scores.
Those raw labels are just individual words. They lack structure. By feeding them as text into Amazon Comprehend, you can extract entities (like locations and people) and key phrases, turning a flat list into structured NLP insights.
In this step, get ready to:
- Write an analysis function that builds a text string from Rekognition labels and calls Comprehend.
- Update your main function to create a Comprehend client and print a formatted report.
- Run the complete pipeline and see Rekognition labels alongside Comprehend entities and key phrases.
Write the analyze_with_comprehend function
Comprehend works with text, not images. Your new function will take the Rekognition labels, build a descriptive sentence from them, and pass that text to Comprehend's entity detection and key phrase extraction APIs.
- In image_labels.py, add this function directly below the existing detect_labels function:
def analyze_with_comprehend(comprehend_client, labels):
"""Feed Rekognition labels into Comprehend for NLP analysis."""
label_text = "This image contains: " + ", ".join(
[f"{label['Name']} ({label['Confidence']:.1f}%)" for label in labels]
)
entities_response = comprehend_client.detect_entities(
Text=label_text, LanguageCode="en"
)
key_phrases_response = comprehend_client.detect_key_phrases(
Text=label_text, LanguageCode="en"
)
return {
"input_text": label_text,
"entities": entities_response["Entities"],
"key_phrases": key_phrases_response["KeyPhrases"],
}
What does this code do?
- label_text builds a sentence like "This image contains: Dog (98.5%), Beach (95.2%), Ocean (91.7%)" from the Rekognition labels.
- detect_entities finds structured entities in the text (people, locations, organizations, quantities).
- detect_key_phrases extracts meaningful phrases with confidence scores.
- The function returns a dictionary containing the original text, entities, and key phrases for easy printing later.
- Save image_labels.py.
- Run your script to confirm there are no syntax errors by running:
python image_labels.py
You should still see the Rekognition labels printed as before. The new function exists but nothing calls it yet.
Seeing a syntax error?
- Check that the function is defined at the top level (same indentation as detect_labels), not accidentally nested inside another function.
- Make sure the f-string inside the list comprehension uses single quotes for dictionary keys: label['Name'] not label["Name"].
- help me fix a syntax error in my analyze_with_comprehend function
Connect Comprehend to the main function
The analysis function is ready. Now you need to create a Comprehend client in main() and wire up the formatted output so both services print side by side.
- In your main() function, find this line:
rekognition_client = boto3.client("rekognition", region_name=region)
- Add this line directly below it to create the Comprehend client:
comprehend_client = boto3.client("comprehend", region_name=region)
- Now scroll to the bottom of main(), after the for loop that prints each label. Add this code below it:
# Analyze with Comprehend
print("\n--- Analyzing labels with Comprehend ---")
analysis = analyze_with_comprehend(comprehend_client, labels)
print(f"\nText sent to Comprehend:")
print(f" {analysis['input_text']}")
print("\nEntities found:")
if analysis["entities"]:
for entity in analysis["entities"]:
print(
f" {entity['Text']:20s} Type: {entity['Type']:15s} Score: {entity['Score']:.2f}"
)
else:
print(" No entities detected.")
print("\nKey phrases found:")
if analysis["key_phrases"]:
for phrase in analysis["key_phrases"]:
print(f" {phrase['Text']:30s} Score: {phrase['Score']:.2f}")
else:
print(" No key phrases detected.")
print("\n" + "=" * 60)
print("ANALYSIS COMPLETE")
print("=" * 60)
What does this code do?
- It calls analyze_with_comprehend with the labels from Rekognition, chaining the two services together.
- It prints the exact text string that was sent to Comprehend so you can see what Comprehend received.
- Entities are printed with their Type (LOCATION, PERSON, QUANTITY, etc.) and confidence Score.
- Key phrases show the meaningful multi-word expressions Comprehend found in the label text.
Before you run this, what do you think Comprehend will find in a sentence like "This image contains: Dog (98.5%), Beach (95.2%)"? Will it detect entities, key phrases, or both?
- Save image_labels.py and run the complete pipeline:
python image_labels.py
You should see a formatted report with both Rekognition labels (names and confidence percentages) and Comprehend analysis (entities with types and key phrases with scores) printed together.
What should I see?
The output starts with the familiar Rekognition labels section, followed by a new Comprehend section. Comprehend prints the text it analyzed, any entities it found (with types like QUANTITY or OTHER), and key phrases it extracted.
The exact entities and phrases depend on what labels Rekognition detected in your image. Some images produce more entities than others. Seeing "No entities detected" is normal for certain label combinations.
Getting an AccessDeniedException?
- Your AWS CLI credentials need comprehend:DetectEntities and comprehend:DetectKeyPhrases permissions. If you are using an admin user, these are already included.
- Double-check that the region in your script matches the region your AWS CLI is configured for.
- help me fix an AccessDeniedException for Comprehend
✔️ Awesome, I've got everything!
Great. Double check you have saved image_labels.py and your output shows both Rekognition labels and Comprehend analysis.
ⓧ I'd like to double check the full code
Your image_labels.py should now contain these sections in order. Scroll through your file and confirm each is present:
- import boto3 at the top.
- The detect_labels function (calls Rekognition and returns labels).
- The analyze_with_comprehend function (builds label text, calls detect_entities and detect_key_phrases, returns a dictionary).
- The main() function with both rekognition_client and comprehend_client, printing labels then Comprehend results.
- The if __name__ == "__main__": block at the bottom.
Why chain two AI services together?
Rekognition tells you what objects are in an image. Comprehend tells you what those objects mean in context by extracting structured entities and relationships.
This pattern of feeding one service's output into another is called service chaining. It is a common architecture in AWS for building intelligent pipelines that do more than any single service could alone.
Your image analysis pipeline now chains two AWS AI services together. Next up, you will document this architecture with a professional diagram.
Create Your Architecture Diagram
Your image analysis pipeline is complete. It chains Rekognition and Comprehend together to turn a photo into structured insights.
Documenting that pipeline with a professional architecture diagram is a critical skill for interviews and team collaboration. It also reinforces your understanding of how the services connect. In this step, you will create a visual diagram using draw.io that maps out the flow of data through your system.
In this step, get ready to:
- Find AWS service icons in draw.io's shape library.
- Build the architecture showing your pipeline's data flow.
- Export the diagram as a PNG for your portfolio.
Open draw.io and find AWS icons
draw.io is a free, browser-based diagramming tool with built-in AWS icons. No account is required.
- Open your browser and navigate to app.diagrams.net.
- When prompted for a storage location, select Device to save files locally.
- Click Create New Diagram, leave the default blank diagram selected, and click Create.
You should see an empty canvas with the shapes panel on the left side.
- Click +More Shapes at the bottom of the left side panel.
- Scroll down to the Networking category and enable the AWS library.
- Click Apply.
The left panel now shows AWS service icons you can drag onto the canvas.
What is draw.io?
draw.io (also known as diagrams.net) is a free diagramming tool that runs entirely in your browser. It includes shape libraries for AWS, Azure, GCP, and many other platforms. No installation or sign-up needed.
Place components and draw data flow arrows
Your architecture has four components connected by data flowing left to right.
- Type S3 into the search box at the top of the shapes panel and drag an S3 bucket icon onto the center of the canvas.
- Search for Rekognition and drag the icon to the right of the S3 bucket.
- Search for Comprehend and drag the icon to the right of Rekognition.
- For the Python script, drag a plain rectangle from the General shapes section and place it on the far left of the canvas.
- Double-click the rectangle and type Python Script (Boto3) as its label.
You should now see four components arranged left to right: Python Script, S3, Rekognition, and Comprehend.
- Hover over the edge of the Python Script rectangle until you see a blue arrow. Click and drag from Python Script to the S3 icon to create a connector arrow.
- Draw an arrow from S3 to Rekognition.
- Draw an arrow from Rekognition to Comprehend.
- Draw a final arrow from Comprehend back to the Python Script rectangle.
Your canvas now shows four components connected by arrows representing the data flow through your pipeline.
Align your shapes neatly
Select all shapes (Cmd+A on macOS or Ctrl+A on Windows), then use the Arrange tab in the right panel to align them horizontally for a clean look.
Label the arrows and export as PNG
Labels on each arrow describe what data flows between the components. This makes the diagram readable to anyone who sees it.
- Double-click the arrow from Python Script to S3 and type Upload JPEG.
- Double-click the arrow from S3 to Rekognition and type DetectLabels.
- Double-click the arrow from Rekognition to Comprehend and type Label text.
- Double-click the arrow from Comprehend to Python Script and type Entities + Key Phrases.
Every arrow now has a label explaining what data it carries.
- Click File in the top menu.
- Select Export as, then click PNG.
- Click Export in the dialog that appears.
- Save the file as architecture-diagram.png in your image-labels-project folder.
Why export as PNG?
PNG preserves text clarity and renders consistently on any device. It works in portfolios, presentations, and documentation without requiring the viewer to install draw.io.
Before you check your result, ask yourself: does your diagram clearly show data flowing from your script through S3, into Rekognition, then into Comprehend, and back?
- Open architecture-diagram.png from your image-labels-project folder.
You should see a complete architecture diagram showing the flow from your Python script through S3, Rekognition, and Comprehend with labeled arrows for each data transfer.
Don't see AWS icons in the shapes panel?
Make sure you clicked +More Shapes at the bottom of the left panel, enabled the AWS library under the Networking category, and clicked Apply. The icons only appear after you enable the library.
If the search returns no results for a specific service name, try searching AWS to browse all available icons.
Help me find AWS icons in draw.io
Secret mission
Batch Process Multiple Images
Your script analyzes one image at a time. What if you had a whole folder of photos from a trip, a product catalog, or a security camera feed? In this mission, you'll upgrade your pipeline to batch process an entire folder of images and generate a structured JSON report with label frequency analysis across all images.
Clean Up Your Resources
Clean Up Your Resources
Decide whether to keep your resources running, pause them to come back later, or delete them entirely. This project uses AWS free tier services, so ongoing costs are negligible as long as your free tier is active (12 months from account creation).
Cost warning
If your AWS free tier has expired, S3 storage and API calls will incur small charges. Rekognition costs $0.001 per image after the free tier. Delete your S3 bucket if you are no longer experimenting.
Resources you used:
- S3 bucket (image-labels-your-initials-2026) with uploaded images.
- Local project folder (image-labels-project) with virtual environment, Python script, images folder, and generated report.
- Architecture diagram PNG file exported from draw.io.
Keep everything running
No action needed. Choose this if you are still actively building or want to experiment with more images.
- Your S3 bucket stays available for future uploads and analysis.
- Your local project folder remains on your Desktop with the virtual environment intact.
- Rekognition and Comprehend only charge per API call, so no cost accrues while idle.
Pause - I'll come back to this later
Shut down running processes to free up memory. Since this project has no long-running services, the main action is deactivating your virtual environment.
- Deactivate your virtual environment by running:
- Your S3 bucket remains. Storage cost is minimal (pennies per month for a few images under free tier).
- When you return, reactivate the environment with . .venv/bin/activate (macOS/Linux) or .venv\Scripts\activate (Windows).
deactivate
Delete - I don't want to use this again
Remove all project resources and start fresh. Follow each step below to fully clean up.
- Delete your S3 bucket and all images inside it by running:
aws s3 rb s3://image-labels-your-initials-2026 --force
- Delete your local project folder. On macOS/Linux, run:
rm -rf ~/Desktop/image-labels-project
- On Windows, run:
rmdir /s /q %USERPROFILE%\Desktop\image-labels-project
- Your architecture diagram PNG is stored wherever you exported it. Delete it manually from that location if you no longer need it.
What about Python and Boto3?
Python and Boto3 are general-purpose tools useful beyond this project. The virtual environment (deleted above) contained your Boto3 installation, so no separate uninstall is needed for it. Python itself remains on your system for future projects.
Nice Work!
Nice Work!
Nice work! You just built a complete image analysis pipeline that chains two AWS AI services together and documented it with a professional architecture diagram.
You've learned how to:
- Used Amazon Rekognition to detect objects, scenes, and concepts in images with confidence scores.
- Chained Rekognition labels into Amazon Comprehend for NLP entity and key phrase extraction, demonstrating service chaining on AWS.
- Documented your full pipeline with a professional architecture diagram in draw.io showing data flow across S3, Rekognition, and Comprehend.
- Secret Mission: Built a batch processor that analyzes multiple images and generates a categorized JSON report with label frequency analysis and Comprehend insights.
Ready to quiz yourself?