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秒,如果可能,我想多打幾個電話