takuya-takeuchi / FaceRecognitionDotNet

The world's simplest facial recognition api for .NET on Windows, MacOS and Linux
MIT License
1.27k stars 308 forks source link

Can I save FaceEncoding to a file #54

Closed mithunvs closed 5 years ago

mithunvs commented 5 years ago

I tried serializing the object and saving the file and ended up in error. Is there a way to do this

takuya-takeuchi commented 5 years ago

plz error message

mithunvs commented 5 years ago

IFormatter formatter = new BinaryFormatter(); FileStream s = new FileStream(Directory.GetCurrentDirectory() + @"\FaceEncodings\FaceArray.txt", FileMode.Create); formatter.Serialize(s, fd); s.Close();

I've used this code which didn't end up in error but couldn't get the file as expected. fd is a face encoding object. If you could simply suggest a code, that would be nice.

takuya-takeuchi commented 5 years ago

Thank you for response.

If you could simply suggest a code, that would be nice. https://github.com/takuya-takeuchi/FaceRecognitionDotNet/blob/f3233c9430e7c8fcda49b99b66f2cc2582566cc2/test/FaceRecognitionDotNet.Tests/FaceRecognitionTest.cs#L289

I always execute unit test before package release. Sure, all pass.

mithunvs commented 5 years ago

Thanks for the quick reply and that worked like a charm and by the way this is such a great library. Face recognition is too easy with this. Guess i will close the issue. Keep up the good work