Создание простой демонстрации AWS Rekognition с помощью React с использованием <input type="file">
Получение Invalid image encoding
ошибки.
let file = e.target.files[0];
let reader = new FileReader();
reader.readAsDataURL(file);
reader.onloadend = () => {
let rekognition = new aws.Rekognition();
var params = {
Image: { /* required */
Bytes: reader.result,
},
MaxLabels: 0,
MinConfidence: 0.0
};
rekognition.detectLabels(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Репозиторий GitHub: https://github.com/html5cat/vision-test/
Проблема с GitHub: https://github.com/html5cat/vision-test/issues/1 < / а>