TL;DR
Put the binary data in the value of the key 'Bytes'
and pass it to Image
import boto3
client = boto3.client('rekognition')
with open('image.jpg', 'rb') as f:
response = client.search_faces_by_image(
CollectionId='string',
Image={
'Bytes': f.read()
}
)
In the sample of the world, there were overwhelmingly many cases of passing the image file stored in s3. When passing from s3, it can be analyzed by passing the bucket name and Object name.
response = client.search_faces_by_image(
CollectionId='string',
Image={
'S3Object': {
'Bucket': 'string',
'Name': 'string',
'Version': 'string'
}
},
)
Recommended Posts