Giter Site home page Giter Site logo

Getting this error - System.IO.DirectoryNotFoundException: 'Could not find a part of the path '/mediapipe/graphs/face_mesh/face_mesh_desktop_live.pbtxt about mediapipe.net HOT 10 CLOSED

amalcty avatar amalcty commented on August 10, 2024
Getting this error - System.IO.DirectoryNotFoundException: 'Could not find a part of the path '/mediapipe/graphs/face_mesh/face_mesh_desktop_live.pbtxt

from mediapipe.net.

Comments (10)

sr229 avatar sr229 commented on August 10, 2024

Please provide actionable logs and code samples so we can work with your issue better.

from mediapipe.net.

Speykious avatar Speykious commented on August 10, 2024

Remember that Mediapipe resources such as graphs and modules are not provided by MediaPipe.NET.
You can find them in the original mediapipe repo under mediapipe/graphs and mediapipe/modules.

In particular, the graph you're looking for is here.

from mediapipe.net.

Speykious avatar Speykious commented on August 10, 2024

It also needs to be under the same directory structure, with the mediapipe/ folder directly visible to the executable.
However, you can also create a child of the ResourceManager class where you can load resources manually by providing 2 delegate functions.

from mediapipe.net.

amalcty avatar amalcty commented on August 10, 2024

I have added the mediapipe/ folder directly but still getting the same error. Here is the detailed log

FATAL UNHANDLED EXCEPTION: System.IO.DirectoryNotFoundException: Could not find a part of the path '/mediapipe/graphs/face_mesh/face_mesh_desktop_live_gpu.pbtxt'.
[mono-rt] at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func2 errorRewriter) [mono-rt] at Interop.CheckIo(Error error, String path, Boolean isDirectory, Func2 errorRewriter)
[mono-rt] at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
[mono-rt] at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
[mono-rt] at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
[mono-rt] at System.IO.Strategies.UnixFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
[mono-rt] at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
[mono-rt] at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
[mono-rt] at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
[mono-rt] at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
[mono-rt] at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)
[mono-rt] at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
[mono-rt] at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
[mono-rt] at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
[mono-rt] at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks)
[mono-rt] at System.IO.File.InternalReadAllText(String path, Encoding encoding)
[mono-rt] at System.IO.File.ReadAllText(String path)
[mono-rt] at Mediapipe.Net.Calculators.Calculator2[[Mediapipe.Net.Framework.Packet.NormalizedLandmarkListVectorPacket, Mediapipe.Net, Version=0.8.10.0, Culture=neutral, PublicKeyToken=null],[System.Collections.Generic.List1[[Mediapipe.Net.Framework.Protobuf.NormalizedLandmarkList, Mediapipe.Net.Framework.Protobuf, Version=0.8.9.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]..ctor(String graphPath, String secondaryOutputStream)
[mono-rt] at Mediapipe.Net.Calculators.GpuCalculator2[[Mediapipe.Net.Framework.Packet.NormalizedLandmarkListVectorPacket, Mediapipe.Net, Version=0.8.10.0, Culture=neutral, PublicKeyToken=null],[System.Collections.Generic.List1[[Mediapipe.Net.Framework.Protobuf.NormalizedLandmarkList, Mediapipe.Net.Framework.Protobuf, Version=0.8.9.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]..ctor(String graphPath, String secondaryOutputStream)
[mono-rt] at Mediapipe.Net.Calculators.FaceMeshGpuCalculator..ctor()
[mono-rt] at MauiApp1.MainPage.TakePhoto() in C:\Users\amal.b\source\repos\MauiApp1\MauiApp1\MainPage.xaml.cs:line 56
[mono-rt] at System.Threading.Tasks.Task.<>c.b__128_0(Object state)
[mono-rt] at Android.App.SyncContext.<>c__DisplayClass2_0.b__0() in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.App/SyncContext.cs:line 36
[mono-rt] at Java.Lang.Thread.RunnableImplementor.Run() in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Lang/Thread.cs:line 36
[mono-rt] at Java.Lang.IRunnableInvoker.n_Run(IntPtr jnienv, IntPtr native__this) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net6.0/android-32/mcw/Java.Lang.IRunnable.cs:line 84
[mono-rt] at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V(_JniMarshal_PP_V callback, IntPtr jnienv, IntPtr klazz) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:line 22

from mediapipe.net.

Speykious avatar Speykious commented on August 10, 2024

Could you tell me how you run your project and where you placed the mediapipe/ folder?

from mediapipe.net.

amalcty avatar amalcty commented on August 10, 2024

I run the project on Android emulator and have placed the mediapipe folder in the MauiApp root folder

from mediapipe.net.

Speykious avatar Speykious commented on August 10, 2024

You have to place it in the folder where the executable is. I assume it's somewhere in bin/Debug/[...]/ or bin/Release/[...].

from mediapipe.net.

Speykious avatar Speykious commented on August 10, 2024

Android

I'd also like to mention that we never tested MediaPipe.NET on Android before. Our main targets are Windows and Linux. Maybe the Linux shared library isn't adapted for Android, but in that case it's surprising that it didn't crash in the first place...

from mediapipe.net.

amalcty avatar amalcty commented on August 10, 2024

I tried placing it in this folder bin/Debug/[...]/ or bin/Release/[...] but still getting the same result.
Could you please give a sample of loading it with resource manager ?

from mediapipe.net.

Speykious avatar Speykious commented on August 10, 2024

You can look at the FaceMesh example. It provides a DummyResourceManager and uses it if you run the example with the --use-resource-manager option. You could copy the class and extend it with some print statements to see what's going on, it would also help us in the process.

from mediapipe.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.