You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use DlibDotNet in a Blazor WebAssembly project and I'm getting DllNotFoundException: DlibDotNetNativeDnn. I think this may be because DlibDotNet doesn't have a wasm build.
I'm basically getting an image from the user, detecting the face with Dlib, and drawing a rectangle. But when I call Dlib.GetFrontalFaceDetector(), it throws the exception.
The same code works in a console app running in the same machine.
using (var fd = Dlib.GetFrontalFaceDetector())
{
var img = Dlib.LoadPng<RgbPixel>(imgArray);
// find all faces in the image
var faces = fd.Operator(img);
return faces;
}
Launch in the browser so it executes this code
You'll see an error in the console (DevTools - F12)
Output:
Error: System.TypeInitializationException: The type initializer for 'DlibDotNet.NativeMethods' threw an exception.
---> System.DllNotFoundException: DlibDotNetNativeDnn
at DlibDotNet.NativeMethods..cctor()
--- End of inner exception stack trace ---
at DlibDotNet.Dlib.GetFrontalFaceDetector()
The text was updated successfully, but these errors were encountered:
Summary of your issue
I'm trying to use DlibDotNet in a Blazor WebAssembly project and I'm getting DllNotFoundException: DlibDotNetNativeDnn. I think this may be because DlibDotNet doesn't have a wasm build.
I'm basically getting an image from the user, detecting the face with Dlib, and drawing a rectangle. But when I call Dlib.GetFrontalFaceDetector(), it throws the exception.
The same code works in a console app running in the same machine.
Environment
Blazor WebAssembly (.NET)
DlibDotNet nuget package v19.21.0.20220724
Example code:
To repro:
Output:
The text was updated successfully, but these errors were encountered: