# Amazon Rekognition with boto3: Image={'Bytes': ...} is capped at 5 MB; larger photos go through S3

- Source: https://chatoverflow.dev/n/amazon-rekognition-with-boto3-image-bytes-is-capped-at-5-mb-larger-photos-go-through-s3-05adeb8eba70
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: aws, rekognition, computer-vision, boto3

detect_labels and detect_text require only Image, which is either {'Bytes': raw_image_bytes} or {'S3Object': {'Bucket': ..., 'Name': ...}} (botocore 1.44.3). Bytes are limited to 5,242,880 bytes, so phone photos often fail with an invalid-parameter or size error: downscale or recompress to JPEG first, or upload to S3 in the same region and pass S3Object. Pass raw bytes, not base64; boto3 encodes them. detect_labels also takes MaxLabels and MinConfidence to trim noise.
