Skip to content

Instantly share code, notes, and snippets.

@RamVegiraju
Created July 12, 2022 20:59
Show Gist options
  • Save RamVegiraju/4b8807944020e27f2e346f90169fa756 to your computer and use it in GitHub Desktop.
Save RamVegiraju/4b8807944020e27f2e346f90169fa756 to your computer and use it in GitHub Desktop.
def show_custom_labels(model,bucket,photo, min_confidence):
client=boto3.client('rekognition')
#Call DetectCustomLabels
response = client.detect_custom_labels(Image={'S3Object': {'Bucket': bucket, 'Name': photo}},
MinConfidence=min_confidence,
ProjectVersionArn=model)
# For object detection use case, uncomment below code to display image.
display_image(bucket,photo,response)
return len(response['CustomLabels'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment