Open sledgemhammer opened 4 years ago
Hi, You can create a varchar field and save the descriptors. In this code I parse all the float values in a string and encoding in a json, later you can decode it.
case "/GetTemplate":
response.writeHead(200, {
"Content-Type": "text\plain"
});
var form = new formidable.IncomingForm();
form.parse(request, async function (err, fields, files) {
let buff = new Buffer(fields.picture, 'base64');
const img = await commons.canvas.loadImage(buff);
let detections = await faceapi.detectSingleFace(img, faceDetectionOptions).withFaceLandmarks().withFaceDescriptor();
if (detections) {
let encoding = {};
let vecEnco = [];
for (var i = 0; i < detections.descriptor.length; i++)
vecEnco.push(detections.descriptor[i]);
encoding.Encoding = "[" + vecEnco.toString() + "]";
console.log("GetTemplate: template encontrado");
response.write(JSON.stringify(encoding));
}
else {
console.log("GetTemplate: template NO encontrado");
response.write(null);
}
response.end();
});
break;
@neumartin Do you add this code in face-api.js or create it's own file and call in in face-api.js? Thanks
@neumartin Do you add this code in face-api.js or create it's own file and call in in face-api.js? Thanks
I created my own js file, using face-api.js
Hi,
I would like to save detected faces into a database for later repeat recognition. I keep failing in doing this because of not understanding the data structure. (can be any db but preferable mysql)
Can you provide some clue how to store a detected face landmarks and gender into a db and how to get the data into face-api again after a reboot ? this way the system can be "self learning" recognising recurrent faces