Skip to content

Instantly share code, notes, and snippets.

@Pelirrojo
Created March 13, 2024 23:15
Show Gist options
  • Save Pelirrojo/7415c1798014b53fa8f6b6014755fce8 to your computer and use it in GitHub Desktop.
Save Pelirrojo/7415c1798014b53fa8f6b6014755fce8 to your computer and use it in GitHub Desktop.
import boto3
# Cacheable references
rekognition = boto3.client("rekognition")
# Function to call Amazon Rekognition and detect faces in an image
async def detect_faces(image_path):
"""Count the number of faces in one app"""
with open(image_path, "rb") as image_file:
image_bytes = image_file.read()
response = rekognition.detect_faces(Image={"Bytes": image_bytes}, Attributes=["ALL"])
return response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment