1
我试着分析与AWS Rekognition进行API调用并行
在一个循环的主要功能多张图片:
with open("Test/frame%d.jpg" % count, "rb") as image:
for face in RekognitionClass.detect_faces(image):
=>Process result and write in DB
Rekognition类:
def detect_faces(image, attributes=['ALL'], region="eu-west-1"):
rekognition = boto3.client("rekognition", region)
response = rekognition.detect_faces(Image={'Bytes': image.read()}, Attributes=attributes)
return response['FaceDetails']
但一个API调用约需至少2秒,如果可能,我想多打几个电话