Rekognify is an image recognition tool developed using AWS SAM and Golang.
The Rekognify architecture consists of the following components:
- AWS S3: For storing uploaded images.
- AWS Lambda: Processes images and generates recognition results.
- AWS SQS: Acts as a buffer zone for incoming tasks.
- AWS API Gateway: Provides endpoints for uploading images and retrieving results.
- AWS Rekognition: Performs image classification and labeling.
- AWS Cloudfront: Used to accelerate media delivery.
- AWS DynamoDB: Stores the classification labels.
You can use the following cURL command to generate an S3 PreSigned URL and upload the image directly to the S3 bucket:
Request:
curl --location 'https://api.rekognify.com/upload' \
--header 'Content-Type: application/json' \
--data '{
"filename": "test.jpg",
"mimeType": "image/jpeg"
}'Response:
{
"url": "https://presigned-s3-url",
"id": "test-uuid.jpg"
}url: The S3 PreSigned URL.id: The unique name or ID of the uploaded image.
Supported MIME Types:
image/jpegimage/pngimage/gifimage/webp
Note: Ensure the uploaded image matches the specified MIME type.
Upload the Image:
Use the PUT method with the PreSigned URL to upload the image. A 200 OK status should be returned upon success.
Query the API to retrieve the classification labels for the uploaded image.
Request:
curl --location 'https://api.rekognify.com/info/{test-uuid}.jpg'Response:
{
"filename": "{test-uuid}.jpg",
"url": "https://cdn.rekognify.com/{test-uuid}.jpg",
"labels": [
{
"category": "Weapons and Military",
"confidence": 97.92,
"name": "Launch"
},
{
"category": "Weapons and Military",
"confidence": 86.16,
"name": "Weapon"
}
]
}filename: The name of the uploaded image.url: The CDN-hosted URL for the uploaded image.labels: An array of classification results withcategory,confidence, andnamefor each identified label.
- AWS CLI already configured with Administrator permission.
- Docker installed.
- SAM CLI - Install the SAM CLI.
- Golang.
The built-in sam build command is used to build a Docker image from a Dockerfile and then copy the source of your application into the Docker image.
This project is licensed under the MIT License - see the LICENSE file for details.