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 Recognition Error #199

Open
masgh21 opened this issue Mar 16, 2022 · 2 comments
Open

Face Recognition Error #199

masgh21 opened this issue Mar 16, 2022 · 2 comments

Comments

@masgh21
Copy link

masgh21 commented Mar 16, 2022

Hello
I compared two similar faces ,
but it got this error ,
they are different person .
My code :

var match = FaceRecognition.CompareFace(FaceRecognition.LoadFaceEncoding(Face1), FaceRecognition.LoadFaceEncoding(Face2), 0.6);

my faces are here :
face1
https://pasteboard.co/47Voil1zyrSk.jpg
face2
https://pasteboard.co/XJt2cvEFEenn.jpg

@takuya-takeuchi
Copy link
Owner

@masgh21
I tried the above image by FRDN and face_recognition.

> python face_distance.py
The test image has a distance of 0.44 from known image #0
- With a normal cutoff of 0.6, would the test image match the known image? True
- With a very strict cutoff of 0.5, would the test image match the known image? True
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using FaceRecognitionDotNet;

namespace Issue
{

    class Program
    {

        private static void Main(string[] args)
        {
            var modelDir = Environment.GetEnvironmentVariable("FaceRecognitionDotNetModelDir");
            using var fr = FaceRecognition.Create(modelDir);
            using var imageA = FaceRecognition.LoadImageFile("face1.jpg");
            using var imageB = FaceRecognition.LoadImageFile("face2.jpg");
            var locationA = fr.FaceLocations(imageA);
            var locationB = fr.FaceLocations(imageB);
            var encodingA = fr.FaceEncodings(imageA, locationA).FirstOrDefault();
            var encodingB = fr.FaceEncodings(imageB, locationB).FirstOrDefault();
            var distance = FaceRecognition.FaceDistance(encodingA, encodingB);
            Console.WriteLine($"The test image has a distance of {distance} from known image");
        }

    }

}
> dotnet run -c Release
The test image has a distance of 0.4335339156795077 from known image

It may be difficult.

@GioviQ
Copy link

GioviQ commented Apr 5, 2022

See #197

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

3 participants