justadudewhohacks / face-api.js

JavaScript API for face detection and face recognition in the browser and nodejs with tensorflow.js
MIT License
16.69k stars 3.71k forks source link

Compute and compare the descriptors of two face images #64

Closed AsmaaHailane closed 6 years ago

AsmaaHailane commented 6 years ago

Hi thank you a lot for your efforts, but i need some helps in the face recognition : my goal is to compare two face images for that i compute the descriptor o each image and the euclidean Distance the same thing in the examples when i enter the same person and the same image it gives me 'match' but when i enter for example different photographs of the same person the result is 'no match' i really need to compare different photographs of the same person

justadudewhohacks commented 6 years ago

Can you append some screenshots for your example, that is not working? Also some code snippets would be helpful. Are you performing face detection and alignment?

AsmaaHailane commented 6 years ago

yes of course ! first i detect the faces in the images than i compute their descriptors . this an example :

capture1 and for the code i use this : ``

``

justadudewhohacks commented 6 years ago

Hmm it says match, or am I missing something. Also are you computing the face bounding box for the second image as well? descriptor1 = await faceapi.computeFaceDescriptor(inputImgEl) looks like you are passing the entire image and not the extracted face image.

You can also use faceapi.allFaceMtcnn to get the bounding boxes + descriptors, so you don't have to do everything on your own.

AsmaaHailane commented 6 years ago

Hi again , you are right it's my fault you are right when i use computeFaceDescriptor i pass the entire image that why it's give me error in matching !!!! thanks a lot :+1:

Vishi234 commented 4 years ago

I have two base64 image and both image has a single face i want to compare both faces. can any one help men

neerajrajput05 commented 3 years ago

Hi, I am new in tensorflow js. I am working detect and recognized images between realtime web cam and stored in db. Can any one Please suggest me from where i can start in react js.

I intgreated this @tensorflow-models/blazeface module i am able to detect the faces in real time web cam. i do not under stand how to convert image in tensor. now i am not able to understand what i do after that. I am very thankfull if any one help me.