Closed turowicz closed 5 years ago
Ideally it would be nice to be able to create a FaceEncoding
from double[]
Please use serializer for FaceEncoding. I know it is easy to support creating FaceEncoding from double[].
However, if you creare it from array, you have to pass row and column value. It means you have to store array, row, column to disk.
Could you show me how to create it using serializer? I've got it as OpenCvSharp Mat
object.
The constructior needs to be public then.
@takuya-takeuchi
@takuya-takeuchi I've got all my face encodings persisted as double[]
because this is what python dlib
+ face_recognition
uses. Any idea how to make this work with your port?
This is how I managed to convert double[]
to FaceEncoding
:
double[] identity = GetIdentity();
var identityEncoding = new FaceEncoding(new Matrix<double>(identity, identity.Length, 1));
This is how I managed to convert
double[]
toFaceEncoding
:double[] identity = GetIdentity(); var identityEncoding = new FaceEncoding(new Matrix<double>(identity, identity.Length, 1));
This is exactly what I need, but FaceEncoding has a private constructor. How did you manage to work arround this?
TBH, I can not understand why some developer requires this function. Already, FaceEncoding has serializable attribute and it can save it as file. So generally we need not to import 'raw' binary data. Do you have reason which convince me? Perhaps, I guess you already had created face encoding data which are by application like OpenCV.
P.S. I could implement it as static method like FaceRecognition.LoadImage at best. Definitely, I do NOT change private to public.
I did not see how i can save it as file. Do you have an example for me? Since that would be more than fine aswell!
That is amazing, thank you!
@MitchVonk I pulled the code and changed the constructor myself in CI :D
latest version 1.2.3.10 support to create FaceEncoding from double array by using LoadFaceEncoding method. Please use it.
I store face encodings in a database in encrypted form. I need to be able to load them up without using any image files and use them in C#. So far I've been working with python and that feature is available there.
Unfortunately the constructor of
FaceEncoding
isprivate
in https://github.com/takuya-takeuchi/FaceRecognitionDotNet/blob/master/src/FaceRecognitionDotNet/FaceEncoding.cs#L12