Last active
March 7, 2023 03:18
-
-
Save jaeyow/bfe5a2f2f2f8b4a83d0a7fd31a1a5b1b to your computer and use it in GitHub Desktop.
python method to call an Amazon Rekognition Custom Labels 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 getCustomLabelsOfImage(model_arn, bucket_name, image): | |
# Use boto3 call detect_custom_labels API call to get Rekognition Custom Labels | |
client = boto3.client("rekognition") | |
response = client.detect_custom_labels( | |
ProjectVersionArn=model_arn, | |
Image={"S3Object": {"Bucket": bucket_name, "Name": image}}, | |
MinConfidence=98, | |
) | |
return response["CustomLabels"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment