- Newest
- Most votes
- Most comments
Below the suggested steps to locate the issue:
-
Image File Integrity • Ensure the image file on the server is identical to the one used locally. • Sometimes, file encoding or transfer methods (e.g., via HTTP or FTP) can alter the image slightly.
-
Image Format and Size • Rekognition supports JPEG and PNG formats. • Images must be less than 15MB (for base64-encoded) or 5MB (for S3 objects).
-
Permissions and IAM Role • Ensure the server has the correct IAM role or credentials to access Rekognition. • The role must have rekognition:DetectModerationLabels permission.
-
Image Source Method • Are you using S3 object or byte stream? • If using S3, ensure the object is publicly accessible or the IAM role has access.
-
Environment Differences • Local machine might have different versions of boto3, botocore, or Python. • Server might have a proxy, firewall, or network restriction affecting the API call.
-
Logging and Debugging
Hey,
Hope you're keeping well.
If the same image returns moderation labels locally but not on the server, it usually means the image content being sent to Rekognition from the server is not identical to what you tested locally. Double-check that the server is reading the correct file and not compressing, resizing, or stripping metadata before calling detect_moderation_labels. Also verify your IAM role or credentials on the server have the rekognition:DetectModerationLabels permission and that the API call is going to the same AWS Region as your local test. You can log the base64 size or S3 object key right before the API call to confirm the input matches exactly.
Thanks and regards,
Taz
answered a year ago
Relevant content
asked 5 years ago
asked 4 years ago
asked 6 years ago
- AWS OFFICIALUpdated 3 months ago
