Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Face-api. js taking much time to compare 2 images #914

Open
isourabhsingh opened this issue Jul 11, 2023 · 0 comments
Open

Face-api. js taking much time to compare 2 images #914

isourabhsingh opened this issue Jul 11, 2023 · 0 comments

Comments

@isourabhsingh
Copy link

isourabhsingh commented Jul 11, 2023

My Code

const face1 = await faceapi.detectSingleFace(file1).withFaceLandmarks().withFaceDescriptor();
const face2 = await faceapi.detectSingleFace(file2).withFaceLandmarks().withFaceDescriptor();
if ( face1 && face2 ) {
                        const distance = faceapi.euclideanDistance(face1.descriptor, face2.descriptor);
                        const threshold = 0.6;
                        console.log(new Date() + " - " + distance + imagePath);
                        if (distance < threshold) {
                             console.log('Image Has Been Matched');
                        } else {
                            alert('Faces are not similar');
                        }
     }
            here file1 is base64 string and file2 is image link eg(https://example.com/image.jpg)
@isourabhsingh isourabhsingh closed this as not planned Won't fix, can't repro, duplicate, stale Jul 11, 2023
@isourabhsingh isourabhsingh reopened this Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant