SmartCrop: You have provided a FaceIndex value that exceeds the length of the zero-based detectedFaces array.
See original GitHub issueI’m attempting to use the smartCrop
option:
edits: {
smartCrop : true
}
This error is logged in CloudWatch:
{ status: 400,
code: 'SmartCrop::FaceIndexOutOfRange',
message: 'You have provided a FaceIndex value that exceeds the length of the zero-based detectedFaces array. Please specify a value that is in-range.' }
It is failing because of this line. It doesn’t first check if any faces were detected before it starts defining the bounding box. In my opinion, smartCrop
should fail gracefully (not crop) if no faces were detected in the image. Would you accept a PR for this, or provide some advisement on how best to implement it?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:23 (5 by maintainers)
Top Results From Across the Web
SmartCrop: You have provided a FaceIndex value ... - GitHub
SmartCrop: You have provided a FaceIndex value that exceeds the length of the zero-based detectedFaces array. #133.
Read more >Smart cropping with Amazon Rekognition - AWS Documentation
Detected faces are indexed in a zero-based array from the largest detected face to the smallest. If this value is not specified, Amazon...
Read more >exceeds the number of array elements in image processing.
The given code below shows an error that index exceeds the number of array elements. ... is not always the same size, can...
Read more >Dynamic Media image profiles | Adobe Experience Manager
When uploading images, you can automatically crop the image upon upload by applying an image profile to the folder. ... Smart Crop is...
Read more >smartcrop - npm
Smartcrop.js implements an algorithm to find good crops for images. It can be used in the browser, in node or via a CLI....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I upgraded to v5.2.0. It returns a 400 error with these settings:
No matter what padding value I try it returns the same error. If no padding is passed it does return a face very closely cropped and not really usable.
can we expect this to be fixed in the next release, waiting for this since July. Also I hope the images will be cached after processing as calls to rekognition are chargeable.