Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import boto3
# From Alex Casalboni:
def detect_labels(bucket, key, max_labels=10, min_confidence=95, region=REGION):
# I have separate profiles in aws so I have to define one here
# in order to authenticate myself to my account
# If you do not have multiple profiles, just remove the argument
session = boto3.Session(profile_name='<profile bname>')
rekognition = session.client("rekognition", region)
response = rekognition.detect_labels(
"S3Object": {
"Bucket": bucket,
"Name": key,
return response.get('Labels', None)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment