I'm trying to connect two separate codes into one program. I need to put one string from first to second part.
First:
import boto3
if __name__ == "__main__":
bucket='BUCKET-NAME'
collectionId='COLLECTION-ID'
fileName='input.jpg'
threshold = 70
maxFaces=1
client=boto3.client('rekognition')
response=client.search_faces_by_image(CollectionId=collectionId,
Image={'S3Object':{'Bucket':bucket,'Name':fileName}},
FaceMatchThreshold=threshold,
MaxFaces=maxFaces)
faceMatches=response['FaceMatches']
for match in faceMatches:
print (match['Face']['FaceId'])
Second:
import boto3
from boto3.dynamodb.conditions import Key, Attr
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('faces')
response = table.scan(
FilterExpression=Attr('faceid').eq('FaceId')
)
items = response['Items']
print(items)
I need to put ID shown by print (match['Face']['FaceId']) from first code to FaceId in second code.
I tried to define a variable and put a value into it and then get it later but I could not do it correctly