Last active
March 7, 2023 03:18
-
-
Save jaeyow/bd1e89519a0973496c6061bbb021a61d to your computer and use it in GitHub Desktop.
python method to call an Amazon Rekognition label detection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getLabelsOfImage(bucket_name, number_labels, image): | |
# Use boto3 call detect_labels to get Amazon Rekognition labels | |
client = boto3.client("rekognition") | |
response = client.detect_labels( | |
Image={"S3Object": {"Bucket": bucket_name, "Name": image}}, | |
MaxLabels=number_labels, | |
MinConfidence=98 | |
) | |
return response["Labels"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment