Closed arnab77in closed 4 years ago
@arnab77in FaceEncoding has Serializable attribute and you can serialize.
@takuya-takeuchi Thanks it is working. I have another issue. Is there any way I can put some indexing while comparing a face with list of faces so that it can return the index of the image it matched. that way I can find out which image it matched. otherwise I can to match every single face one by one.
Can you also tell me what should be the idle performance(time taken) to match an image with 100K images.
I have another issue. Is there any way I can put some indexing while comparing a face with list of faces so that it can return the index of the image it matched. that way I can find out which image it matched. otherwise I can to match every single face one by one.
Does it mean is there cache architecture, right? Answer is no. This task is not FRDN. FRDN is thin wrapper of face_recognition.
Can you also tell me what should be the idle performance(time taken) to match an image with 100K images.
I have no data about face compare performance. But there is other performance data. https://github.com/takuya-takeuchi/FaceRecognitionDotNet/issues/4
please consider the line below inside https://github.com/takuya-takeuchi/FaceRecognitionDotNet/blob/master/src/FaceRecognitionDotNet/FaceEncoding.cs
internal Matrix<double> Encoding => this._Encoding;
change to ===>
public Matrix<double> Encoding => this._Encoding;
that can make us easy persit the landmark data into any storage or any kind db we want.
I have done it as per @takuya-takeuchi advice SerializationInfo sz = new SerializationInfo(strdata.GetType(), format);
encoding.GetObjectData(sz, scon);
var dbl = (double[])sz.GetValue("_Encoding", typeof(double[]));
Thanks
@timiil What's the arnab77in's aproach wrong? API should be simple and not expose what we need not to use. FaceEncoding already supports serialize.
that can make us easy persit the landmark data
What does it mean? FaceEncoding does not contain landmark data. It contains face feature data (yes, this metaphor is not correct but not bad).
my spell mistake, i means sometimes we need to persit the 'feature data' (128 * 64bit double)' into any kind of persitance backend.
may be we can expose like :
public ReadOnlyCollection<double> RawEncoding => ...
i think this aproach is simpler than SerializationInfo :)
@timiil What purpose do you use double[] data? You have to create FaceEncoding object even though deserialize from storage. But FaceEncoding has not public constructors. How do you use it on FaceRecognitionDotNet?
I will NOT expose public constructors.
Is there some useful idea for using raw encoding except for serialize?
one example: we need to get a known people's face features (128 * double) use FRDN on a x64 web server and its db. therefore we need to transform the data to a remote device over network,the device may running python | golang | something just use dlib internally.
that should be one reason we need the feature data quickly persist and transport.
@timiil OK. I understand.
I will provide GetRawEncoding method. But I will not expose public constructors. Because
Done. 419383d2ed3082a4d37cd983915684b0b1b3d79e
Thanks you and agree with you that do not expose the constructor of FaceEncoding.
here is another consideration please, the FaceEncoding class do not have properties to record: 'the image where its from', 'the rectangle where its from', 'the Entity
I want to save encoding data to database. How to convert encoding data to double array do that I can save it