cosyneco / MediaPipe.NET

Pure .NET bindings for Google's MediaPipe.
MIT License
97 stars 18 forks source link

Unable to find an entry point #34

Closed Cactus-TV closed 1 year ago

Cactus-TV commented 2 years ago

I have an error while creating ImageFrame for FaceMeshCpuCalculator: Unable to find an entry point named 'mp_ImageFrame__ui_i_i_i_Pui8_PF' in DLL 'mediapipe_c'.

Here is part of the code: var frame = camera.GetFrame(); converter = new FrameConverter(frame, PixelFormat.Rgba); Frame? cFrame = converter.Convert(frame); imgframe = new ImageFrame(ImageFormat.Srgba, cFrame.Width, cFrame.Height, cFrame.WidthStep, cFrame.RawData);//this row causes error

Here is libraries: using Mediapipe.Net.Framework.Protobuf; using Mediapipe.Net.Calculators; using Mediapipe.Net.Framework.Format; using SeeShark; using SeeShark.Device; using SeeShark.FFmpeg;

Pls give my piece of advice pls, i really need your help.

Speykious commented 2 years ago

What version of the runtime package are you using? (Mediapipe.Net.Runtime.CPU/GPU)

Cactus-TV commented 2 years ago

Mediapipe.Net.Runtime.CPU 0.8.9.1 Mediapipe.Net 0.8.10

Speykious commented 2 years ago

This seems to be a mismatch between Mediapipe.NET and the runtime package. I'll have to go back to track what I was doing back then.

Thelegendseb commented 2 years ago

Hello all, ive just encountered this error as well with the CPU runtime, due to me trying to initialise a ImageFrame instance. @Speykious has there been any update on this?

Speykious commented 2 years ago

Hello all, ive just encountered this error as well with the CPU runtime, due to me trying to initialise a ImageFrame instance. @Speykious has there been any update on this?

Sorry for not getting on fixing this issue sooner. I finally have some time for Mediapipe though, so it'll come around shortly.

For a clearer context, here is the exact commit that causes this issue: https://github.com/vignetteapp/MediaPipe.NET.Runtime/pull/11/commits/e1ee6c66e2ef6be752ba9fea8a49e800be7d7c82

It comes from the latest changes in MediaPipe.NET.Runtime where we copy the pixel data to the native side, instead of faking a borrowing mechanism which later down the line causes memory management problems. Though I now realize our versioning method (<mediapipe-version>.n) causes problems of clarity for breaking changes...

I'll try to finish and merge #33 as soon as possible so that this doesn't occur. While waiting, you can use version 0.8.9 of MediaPipe.NET.Runtime, which iirc has the old call. Though it also means that it won't copy the pixel data, so you'll have to be careful with fake borrowing.

Thelegendseb commented 2 years ago

mechanism

No worries, I will wait for the update.

Good luck and good work, impressive stuff you've done here!