Facial recognition example? Contact info? and you now have a dependent on NPM #23
Replies: 4 comments 3 replies
-
I'll definitely check it out! Never played with
Yes, you have :) On the topic of non-issue messages, github recently allows for discussions & i've just enabled it (see top menu line, close to issues)! (and i've moved this issue to be a first post in discussions) |
Beta Was this translation helpful? Give feedback.
-
Yes, I use similar approach in my apps, just didn't see the need to put it in demo app as it uses fixed demo images. |
Beta Was this translation helpful? Give feedback.
-
I did see that, but didn't find it a complete solution. In hindsight, it should probably be moved from app level to library level. function flattenObject(object) {
const stripped = {};
for (const key of Object.keys(object)) {
if (key[0] === '_') stripped[key.substr(1)] = object[key];
else stripped[key] = object[key];
}
return stripped;
}
async function faceapiClassify(image) {
const results = await models.faceapi.detectAllFaces(image, models.faceapi.options)
.withFaceLandmarks()
.withFaceExpressions()
.withFaceDescriptors()
.withAgeAndGender();
const faces = [];
for (const result of results) {
const emotion = Object.entries(result.expressions).reduce(([keyPrev, valPrev], [keyCur, valCur]) => (valPrev > valCur ? [keyPrev, valPrev] : [keyCur, valCur]));
const object = {
scoreGender: result.genderProbability,
gender: result.gender,
age: result.age,
descriptor: result.descriptor,
scoreEmotion: emotion && emotion[1] ? emotion[1] : 0,
emotion: emotion && emotion[0] ? emotion[0] : '',
box: flattenObject(result.detection.box),
points: result.landmarks.positions.map((a) => flattenObject(a)),
};
faces.push(object);
}
return faces;
} |
Beta Was this translation helpful? Give feedback.
-
that works. my function remaps everything (not just descriptors) to structure i like and then if i want to store it, it's simple |
Beta Was this translation helpful? Give feedback.
-
Facial recognition example:
I've tried many times now to get a vanilla nodeJS environment to work with your example flow but its not been a priority as I've been busy with my own repo. However I do have a working version of facial recognition that works with your face-api in node-red.
If you take a look at my facial-recognition.js line in code 771 to 828. It allows a user to just name the folder and put images into it. Thought you might find this helpful.
Your Contact info
I wanted to email you a link to a server running the node-red version of Facial recognition based on your face-api so you could play around with it if you wanted, also so i did not have to blast/treat your issues section as a message board.
I think I found your Instagram do you want me to send you a message there?
you now have a dependent on NPM
https://www.npmjs.com/browse/depended/@vladmandic/face-api
I'm proud to be the first one on the list
Thanks again,
Meeki
I'm just so tickled i got this working:
Beta Was this translation helpful? Give feedback.
All reactions