Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calling Rekognition using AWS CLI

I have the AWS CLI installed on Windows and am using the Windows command prompt.

I am trying to use Rekognition but I cannot seem to get any commands working. The closest I have gotten is with:

aws rekognition detect-faces --image S3Object=\{Bucket=innovation-bucket,Name=image.jpg,Version=1\} --attributes "ALL" --region us-east-1

This results in:

Error parsing parameter '--image': Expected: ',', received: '}' for input: S3Object={Bucket=innovation-bucket,Name=image.jpg,Version=1}

Why is it expecting a comma?

EDIT:

When I try the format from the documentation I also get errors:

aws rekognition detect-faces --image '{"S3Object":{"Bucket":"innovation-bucket","Name":"image.jpg"}}' --attributes "ALL" --region us-east-1

Error parsing parameter '--image': Expected: '=', received ''' for input: '{"S3Object":{"Bucket":"innovation-bucket","Name":"image.jpg‌​"}}'

like image 721
Sara Fuerst Avatar asked Jun 14 '26 22:06

Sara Fuerst


1 Answers

1) Your AWS CLI should be something like below, refer this documentation:

aws rekognition search-faces-by-image \
--image '{"S3Object":{"Bucket":"bucket-name","Name":"Example.jpg"}}' \
--collection-id "collection-id" \
--region us-east-1 \
--profile adminuser

2) If your AWS CLI installed on windows box, make sure you change "the single quotes to double quotes and the double quotes to escaped quotes"

like image 130
kosa Avatar answered Jun 17 '26 22:06

kosa