kavya sudeep
kavya sudeep

Reputation: 43

Has anyone worked on AWS Rekognition Custom labels lately? Receiving error while trying to analyse the model created via CLI(Windows machine)

I have trained a dataset with few images and i am trying to pass an image to analyse the trained data. I am trying to analyse data via AWSCLI as per doc but receiving error for the image input part, using windows Errors: 1. Error parsing parameter '--image': Expected: '=', received: ''' for input: 2. Error parsing parameter '--image': Invalid JSON: Expecting property name enclosed in double quotes: line 1 column 3 (char 2) JSON received: { S3Object:{ Bucket: source, Name: image}}

Tried Commands: aws rekognition detect-custom-labels --project-version-arn "arn:aws:rekognition:****" --image '{"S3Object": {"Bucket": "source","Name": "image.jpg"}}' --region us-east-1

aws rekognition detect-custom-labels --project-version-arn "arn:aws:rekognition:***" --image "{^"S3Object^":{^"Bucket^":^"source^",^"Name^":^"testing^"}}" --min-confidence 70

AWS documentation says to use commands aws rekognition detect-custom-labels --project-version-arn "model_arn"\ --image '{"S3Object":{"Bucket":"bucket","Name":"image"}}'\ --min-confidence 70 aws rekognition detect-custom-labels \ --project-version-arn "arn:aws:rekognition:*****" \ --image '{"S3Object": {"Bucket": "MY_BUCKET","Name": "PATH_TO_MY_IMAGE"}}' \ --region us-east-1

Please help with your inputs

Upvotes: 0

Views: 755

Answers (1)

jarmod
jarmod

Reputation: 78653

It's quite challenging to get this command line right.

On Mac and Linux:

aws rekognition detect-labels --image '{ "S3Object": {"Bucket":"mybucket", "Name":"image.jpg"} }' --min-confidence 70

On Windows:

aws rekognition detect-labels --image "{ \"S3Object\": {\"Bucket\":\"mybucket\", \"Name\":\"image.jpg\"} }" --min-confidence 70

Alternatively, on Windows you can use repeated double quotes:

aws rekognition detect-labels --image "{ ""S3Object"": {""Bucket"":""mybucket"", ""Name"":""image.jpg""} }" --min-confidence 70

Note that 70 is quite a low confidence score so watch out for false positives.

Upvotes: 1

Related Questions