Open reymesson1 opened 5 years ago
////*************************************
//working fine - comparefaces from mobile
////*************************************
var params = {
SourceImage: {
S3Object: {
Bucket: "rekognition-video-console-demo-iad-352250014224-1vio7fvwvq5qve",
// Name: "amazon-ceo-jeff-bezos_2.jpg"
Name: "PUCMM2.JPG"
}
//Bytes: buffer
// Video: buffer
},
TargetImage: {
// Bytes: buffer2
S3Object: {
Bucket: "webpaa-deployments-mobilehub-2128298286",
// Name: "amazon-ceo-jeff-bezos_2.jpg"
Name: "PUCMM.jpg"
// Name: "getty_946964370_200013332000928085_381902.jpg"
}
},
SimilarityThreshold: 0,
};
// // var params = {
// // Image: {
// // Bytes: buffer2
// // },
// // Attributes: [
// // 'ALL',
// // ]
// // };
// // rekognition.detectFaces(params, async (err, data) =>{
rekognition.compareFaces(params, async (err, data) =>{
table = "<table><tr><th>Low</th><th>High</th></tr>";
if (err){
table += "</tablee>";
console.log(err, err.stack); // an error occurred
}
else {
// // show each face and build out estimated age table
// for (var i = 0; i < data.FaceDetails.length; i++) {
for (var i = 0; i < data.FaceMatches.length; i++) {
table += '<tr><td>' + data.FaceMatches[i].Similarity + '</td></tr>';
}
table += "</table><br/>"
// table = JSON.stringify(data)
// document.getElementById("opResult").innerHTML = table;
}
});
for (var i = 0; i < data.FaceMatches.length; i++) { table += '
//** //Show Items available in Bucket //** // var paramsBucket =3D { // Bucket: "rekognition-video-console-demo-iad-352250014224-1vio7fvwvq5qve", // MaxKeys: 2 // }; // s3.listObjects(paramsBucket, function(err, data) { // // s3.getObject(paramsBucket, function(err, data) { // if (err){ // console.log(err, err.stack); // an error occurred // }else{ // let scanningParameters =3D // { // TableName: 'orders', // "Item":{ // "id": ''+count+1, // "username" : "admin", // "quantity" : "1", // "project" : "123", // // "description": "AWS alexa " + event.image // "description": "" + JSON.stringify(data) // // "description": "" + event.operation // } // }