takuya-takeuchi / FaceRecognitionDotNet

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

Dlib.LoadImage is unable to read images from image library (even when capabity granted) #227

Open pierresa opened 1 year ago

pierresa commented 1 year ago

Dlib.LoadImage returns "Unable to read file". I have to copy file first to temp folder

takuya-takeuchi commented 1 year ago

@pierresa Could you tell me absolute path you want to have library read? Because dlib can handle only std::string so it can not understand unicode. You can resolve this issue by using FaceRecognition.InternalEncoding property.

pierresa commented 1 year ago

for instance, the path string is: D:\Photos\filles.jpg

takuya-takeuchi commented 1 year ago

It's very weird. Path is simple. So this file may be corrupted or dlib may not support.

I want to reproduce your issue. Could you upload this file?

Or you can try Image LoadImage(byte[] array, int row, int column, int stride, Mode mode) or Image LoadImage(Bitmap bitmap).

pierresa commented 1 year ago

I do not think the issue is with the file as my work around consist of a file copy to Temp directory. As this work around works for me, we can close issue. The only thing that could help understand issue would be a more specific error message.