This repository contains Python scripts to use AWS Rekognition for detecting objects in images and faces in videos, displaying results with bounding boxes, and storing face detection results in a pandas DataFrame.
This repository provides two main functionalities using AWS Rekognition:
- Object Detection in Images: Detects objects in an image and visualizes them with bounding boxes.
- Face Detection in Videos: Detects faces in a video stored in an S3 bucket, retrieves detailed information about the faces, and stores the results in a pandas DataFrame.
- AWS account with Rekognition and S3 services enabled.
- AWS credentials.
- Python 3.x installed.
- Required Python packages:
- boto3
- pandas
- matplotlib
- Pillow
-
Clone the repository:
git clone https://github.com/yourusername/aws-rekognition-detection.git cd aws-rekognition-detection
-
Install the required packages:
pip install boto3 pandas matplotlib Pillow
-
Update the script
detect_objects.py
with the absolute paths of your AWS credentials CSV file and the image file:credentials_path = r'path/to/your/credentials.csv' photo_path = r'path/to/your/photo.jpg'
-
Run the script:
python detect_objects.py
-
The script will display the image with bounding boxes around the detected objects.
-
Update the script
detect_faces.py
with your AWS credentials, region name, S3 bucket name, and video file name:access_key = 'your-aws-access-key'
secret_key = 'your-aws-secret-key'
region_name = 'your-aws-region-name'
bucket_name = 'your-s3-bucket-name'
video_file = 'your-video-file.mp4'
-
Run the script:
python detect_faces.py
-
The script will print the first row of the DataFrame containing the detected faces' information.
This project is licensed under the MIT License - see the LICENSE file for details