I am attempting to run multiple images through the AWS system using python code, just a basic for loop. When I run the code I am getting an error. I am able to run one image but once I attempt to run multiple images I again get an error code.
import boto3
if __name__ == "__main__":
bucket='fastlane'
photo=','.join(('test.png',
'test2.png',
'test3.png',
'test4.png',
'test5.png',
'test6.png',
'test7.png',
'test8.png',
'test9.png',
'test10.png',
'test11.png',
'test12.png',
'test13.png',
'test14.png',
'test15.png',
'test16.png',
'test17.png',
'test18.png'))
client=boto3.client('rekognition')
response=client.detect_text(Image={'S3Object':
{'Bucket':bucket,'Name':photo}})
textDetections=response['TextDetections']
print (response)
print ('Matching faces')
for text in textDetections:
print ('Detected text:' + text['DetectedText'])
print ('Confidence: ' + "{:.2f}".format(text['Confidence']) + "%")
print ('Id: {}'.format(text['Id']))
if 'ParentId' in text:
print ('Parent Id: {}'.format(text['ParentId']))
print ('Type:' + text['Type'])
print
Error code: Traceback (most recent call last): File "main.py", line 37, in response=client.detect_text(Image={'S3Object':{'Bucket':bucket,'Name':photo}}) File "/home/Zeus/farcry/AWS/env/lib/python3.5/site-packages/botocore/client.py", line 320, in _api_call return self._make_api_call(operation_name, kwargs) File "/home/Zeus/farcry/AWS/env/lib/python3.5/site-packages/botocore/client.py", line 624, in _make_api_call raise error_class(parsed_response, operation_name) botocore.errorfactory.InvalidS3ObjectException: An error occurred (InvalidS3ObjectException) when calling the DetectText operation: Unable to get object metadata from S3. Check object key, region and/or access permissions.