Jun-01-2018, 12:23 PM
Hi,
i am new in python trying to index faces using Rekogniton API's and getting the following error:
i am new in python trying to index faces using Rekogniton API's and getting the following error:
Error:DetectionAttributes=[ 'ALL' ]
File "C:\Program Files\Python37\lib\site-packages\botocore\client.py", line 312, in _api_call
"%s() only accepts keyword arguments." % py_operation_name)
TypeError: index_faces() only accepts keyword arguments.
here is the program:import boto3 import json rek = boto3.client('rekognition') # Setup Rekognition s3 = boto3.resource('s3') # Setup S3 print ("Getting Image") your_bucket = s3.Bucket('betaimagefolder1') CollList = rek.list_collections() print(CollList) #response = rek.create_collection(CollectionId='TestYehuda') for s3_file in your_bucket.objects.all(): print(s3_file.key) image = s3.Object('betaimagefolder1',s3_file) # Get an Image from S3 #img_data = image.get()['Body'].read() # Read the image FaceRecord = rek.index_faces( image, CollectionId='TestYehuda', ExternalImageId=None, DetectionAttributes=[ 'ALL' ] ) response1 = rekognition.search_faces_by_image( img_data, CollectionId='TestYehuda', FaceMatchThreshold=threshold, ) MatchRecord = response1['FaceMatches']Thanks!!