-
Notifications
You must be signed in to change notification settings - Fork 311
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
Comments
@masgh21
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. |
See #197 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The text was updated successfully, but these errors were encountered: