Skip to content

Instantly share code, notes, and snippets.

@jaeyow
Last active March 7, 2023 03:18
Show Gist options
  • Save jaeyow/bfe5a2f2f2f8b4a83d0a7fd31a1a5b1b to your computer and use it in GitHub Desktop.
Save jaeyow/bfe5a2f2f2f8b4a83d0a7fd31a1a5b1b to your computer and use it in GitHub Desktop.
python method to call an Amazon Rekognition Custom Labels label detection
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