question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Loading Pose graph in different scenes

See original GitHub issue

Description

MediapipeUnityPlugin: v0.8.2 Unity: 2020.2.1f1 Dev Machine: Windows 10 Pro Target: Android Device: MI Note 8 pro AAR built using: Docker Linux image on Windows. DLL built using: Windows Docker image Target is set to GPU

I am trying to load the model in different scenes. I have attached the Pose Tracking Solution GameObject to my scene with Bootstrap GameObject and accessing models output landmark using the PoseTrackingSolution class.

I am building it for Android and it does not work well in the first run, but when I close the app and run it again it logs the same INFO but does not run. To check whether the model is loaded or not I have added a global variable when is set to true after the following code: Initially it is false

public static bool isGraphLoaded = false;

Later I set it to true here:

yield return new WaitForEndOfFrame();
isGraphLoaded = true;

Sometimes I saw isGraphLoaded never be true. Please let me know if I am doing something wrong here, or maybe if there is any better way to know that graph is loaded or not.

Logs:

2022/02/08 17:53:26.654 11903 11993 Info Unity Bootstrap: Setting global flags...
2022/02/08 17:53:26.654 11903 11993 Info Unity Mediapipe.Unity.MemoizedLogger:Log(LogLevel, String, Object)
2022/02/08 17:53:26.654 11903 11993 Info Unity Mediapipe.Unity.<Start>d__17:MoveNext()
2022/02/08 17:53:26.654 11903 11993 Info Unity UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
2022/02/08 17:53:26.654 11903 11993 Info Unity 
2022/02/08 17:53:26.654 11903 11993 Error native E20220208 17:53:26.654320 11993 logging.cc:18] Aborted
2022/02/08 17:53:26.655 11903 11993 Error Unity MediaPipeException: MediaPipe Aborted, refer glog files for more details
2022/02/08 17:53:26.655 11903 11993 Error Unity   at Mediapipe.MpReturnCodeExtension.Assert (Mediapipe.MpReturnCode code) [0x00000] in <00000000000000000000000000000000>:0 
2022/02/08 17:53:26.655 11903 11993 Error Unity   at Mediapipe.Unity.Bootstrap+<Start>d__17.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 
2022/02/08 17:53:26.655 11903 11993 Error Unity   at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00000] in <00000000000000000000000000000000>:0 
2022/02/08 17:53:26.655 11903 11993 Error Unity 
2022/02/08 17:53:26.658 11903 11993 Info Unity ==> Setting credit: 
2022/02/08 17:53:26.658 11903 11993 Info Unity Mediapipe.Unity.PoseTracking.<fetchAssetBundles>d__39:MoveNext()
2022/02/08 17:53:26.658 11903 11993 Info Unity System.Runtime.CompilerServices.AsyncTaskCache:CreateCacheableTask(TResult)
2022/02/08 17:53:26.658 11903 11993 Info Unity Mediapipe.Unity.PoseTracking.PoseModeDrawing:fetchAssetBundles()
2022/02/08 17:53:26.658 11903 11993 Info Unity System.Action:Invoke()
2022/02/08 17:53:26.658 11903 11993 Info Unity UnityThread:Update()
2022/02/08 17:53:26.658 11903 11993 Info Unity 
2022/02/08 17:53:26.660 11903 11993 Info Unity PoseTrackingGraph: Using OpenGLES config
2022/02/08 17:53:26.660 11903 11993 Info Unity Mediapipe.Unity.MemoizedLogger:Log(LogLevel, String, Object)
2022/02/08 17:53:26.660 11903 11993 Info Unity Mediapipe.Unity.<Initialize>d__35:MoveNext()
2022/02/08 17:53:26.660 11903 11993 Info Unity Mediapipe.Unity.<Run>d__20:MoveNext()
2022/02/08 17:53:26.660 11903 11993 Info Unity UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
2022/02/08 17:53:26.660 11903 11993 Info Unity Mediapipe.Unity.WaitForResult:.ctor(MonoBehaviour, IEnumerator, Int64)
2022/02/08 17:53:26.660 11903 11993 Info Unity Mediapipe.Unity.GraphRunner:WaitForInit()
2022/02/08 17:53:26.660 11903 11993 Info Unity Mediapipe.Unity.PoseTracking.<Run>d__28:MoveNext()
2022/02/08 17:53:26.660 11903 11993 Info Unity UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
2022/02/08 17:53:26.660 11903 11993 Info Unity Mediapipe.Unity.PoseTracking.PoseTrackingSolution:Play()
2022/02/08 17:53:26.660 11903 11993 Info Unity Mediapipe.Unity.<Start>d__4:MoveNext()
2022/02/08 17:53:26.660 11903 11993 Info Unity UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
2022/02/08 17:53:26.673 11903 11993 Info Unity PoseTrackingGraph: Loading dependent assets...
2022/02/08 17:53:26.673 11903 11993 Info Unity Mediapipe.Unity.MemoizedLogger:Log(LogLevel, String, Object)
2022/02/08 17:53:26.673 11903 11993 Info Unity Mediapipe.Unity.<Initialize>d__35:MoveNext()
2022/02/08 17:53:26.673 11903 11993 Info Unity Mediapipe.Unity.<Run>d__20:MoveNext()
2022/02/08 17:53:26.673 11903 11993 Info Unity UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
2022/02/08 17:53:26.673 11903 11993 Info Unity Mediapipe.Unity.WaitForResult:.ctor(MonoBehaviour, IEnumerator, Int64)
2022/02/08 17:53:26.673 11903 11993 Info Unity Mediapipe.Unity.GraphRunner:WaitForInit()
2022/02/08 17:53:26.673 11903 11993 Info Unity Mediapipe.Unity.PoseTracking.<Run>d__28:MoveNext()
2022/02/08 17:53:26.673 11903 11993 Info Unity UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
2022/02/08 17:53:26.673 11903 11993 Info Unity Mediapipe.Unity.PoseTracking.PoseTrackingSolution:Play()
2022/02/08 17:53:26.673 11903 11993 Info Unity Mediapipe.Unity.<Start>d__4:MoveNext()
2022/02/08 17:53:26.673 11903 11993 Info Unity UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
2022/02/08 17:53:26.674 11903 11993 Info Unity StreamingAssetsResourceManager: pose_detection.bytes will not be copied to /storage/emulated/0/Android/data/ai.torquevision.zumbio/files/pose_detection.bytes because it already exists
2022/02/08 17:53:26.674 11903 11993 Info Unity Mediapipe.Unity.MemoizedLogger:Log(LogLevel, String, Object)
2022/02/08 17:53:26.674 11903 11993 Info Unity Mediapipe.Unity.<PrepareAssetAsync>d__11:MoveNext()
2022/02/08 17:53:26.674 11903 11993 Info Unity Mediapipe.Unity.<Run>d__20:MoveNext()
2022/02/08 17:53:26.674 11903 11993 Info Unity UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
2022/02/08 17:53:26.674 11903 11993 Info Unity Mediapipe.Unity.WaitForResult:.ctor(MonoBehaviour, IEnumerator, Int64)
2022/02/08 17:53:26.674 11903 11993 Info Unity Mediapipe.Unity.GraphRunner:WaitForAsset(String, String, Boolean)
2022/02/08 17:53:26.674 11903 11993 Info Unity Mediapipe.Unity.PoseTracking.PoseTrackingGraph:RequestDependentAssets()
2022/02/08 17:53:26.674 11903 11993 Info Unity Mediapipe.Unity.<Initialize>d__35:MoveNext()
2022/02/08 17:53:26.674 11903 11993 Info Unity Mediapipe.Unity.<Run>d__20:MoveNext()
2022/02/08 17:53:26.674 11903 11993 Info Unity UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
2022/02/08 17:53:26.674 11903 11993 Info Unity Mediapipe.Unity.WaitForResult:.ctor(MonoBehaviour, IEnumerator, Int64)
2022/02/08 17:53:26.674 11903 11993 Info Unity Mediapipe.Unity.GraphRunner:WaitForInit()
2022/02/08 17:53:26.674 11903 11993 Info Unity Mediapipe.Unity.PoseTracking.<Run>d__28:MoveNext()
2022/02/08 17:53:26.674 11903 11993 Info Unity UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
2022/02/08 17:53:26.674 11903 11993 Info Unity Mediapipe.Unity.PoseTracking.PoseTrackingSo
2022/02/08 17:53:26.675 11903 11993 Info Unity StreamingAssetsResourceManager: pose_landmark_lite.bytes will not be copied to /storage/emulated/0/Android/data/ai.torquevision.zumbio/files/pose_landmark_lite.bytes because it already exists
2022/02/08 17:53:26.675 11903 11993 Info Unity Mediapipe.Unity.MemoizedLogger:Log(LogLevel, String, Object)
2022/02/08 17:53:26.675 11903 11993 Info Unity Mediapipe.Unity.<PrepareAssetAsync>d__11:MoveNext()
2022/02/08 17:53:26.675 11903 11993 Info Unity Mediapipe.Unity.<Run>d__20:MoveNext()
2022/02/08 17:53:26.675 11903 11993 Info Unity UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
2022/02/08 17:53:26.675 11903 11993 Info Unity Mediapipe.Unity.WaitForResult:.ctor(MonoBehaviour, IEnumerator, Int64)
2022/02/08 17:53:26.675 11903 11993 Info Unity Mediapipe.Unity.GraphRunner:WaitForAsset(String, String, Boolean)
2022/02/08 17:53:26.675 11903 11993 Info Unity Mediapipe.Unity.PoseTracking.PoseTrackingGraph:RequestDependentAssets()
2022/02/08 17:53:26.675 11903 11993 Info Unity Mediapipe.Unity.<Initialize>d__35:MoveNext()
2022/02/08 17:53:26.675 11903 11993 Info Unity Mediapipe.Unity.<Run>d__20:MoveNext()
2022/02/08 17:53:26.675 11903 11993 Info Unity UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
2022/02/08 17:53:26.675 11903 11993 Info Unity Mediapipe.Unity.WaitForResult:.ctor(MonoBehaviour, IEnumerator, Int64)
2022/02/08 17:53:26.675 11903 11993 Info Unity Mediapipe.Unity.GraphRunner:WaitForInit()
2022/02/08 17:53:26.675 11903 11993 Info Unity Mediapipe.Unity.PoseTracking.<Run>d__28:MoveNext()
2022/02/08 17:53:26.675 11903 11993 Info Unity UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
2022/02/08 17:53:26.675 11903 11993 Info Unity Mediapipe.Unity.PoseTracking.PoseTr
2022/02/08 17:53:32.244 11903 11993 Error native E20220208 17:53:32.244141 11993 calculator_graph.cc:152] Unknown exception occured
2022/02/08 17:53:32.248 11903 11993 Error Unity MediaPipePluginException: Unknown exception is thrown in Unmanaged Code
2022/02/08 17:53:32.248 11903 11993 Error Unity   at Mediapipe.MpReturnCodeExtension.Assert (Mediapipe.MpReturnCode code) [0x00000] in <00000000000000000000000000000000>:0 
2022/02/08 17:53:32.248 11903 11993 Error Unity   at Mediapipe.CalculatorGraph.CloseAllPacketSources () [0x00000] in <00000000000000000000000000000000>:0 
2022/02/08 17:53:32.248 11903 11993 Error Unity   at Mediapipe.Unity.GraphRunner.Stop () [0x00000] in <00000000000000000000000000000000>:0 
2022/02/08 17:53:32.248 11903 11993 Error Unity   at Mediapipe.Unity.PoseTracking.PoseTrackingGraph.Stop () [0x00000] in <00000000000000000000000000000000>:0 

Sometimes I get these errors when I enable Glogs:

2022/02/09 13:40:03.276 25110 25150 Info Unity Bootstrap: Setting global flags...
2022/02/09 13:40:03.276 25110 25150 Info Unity Mediapipe.Unity.MemoizedLogger:Log(LogLevel, String, Object)
2022/02/09 13:40:03.276 25110 25150 Info Unity Mediapipe.Unity.<Start>d__17:MoveNext()
2022/02/09 13:40:03.276 25110 25150 Info Unity UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
2022/02/09 13:40:03.276 25110 25150 Error native E20220209 13:40:03.276816 25150 logging.cc:18] Aborted
2022/02/09 13:40:03.277 25110 25150 Error Unity MediaPipeException: MediaPipe Aborted, refer glog files for more details
2022/02/09 13:40:03.277 25110 25150 Error Unity   at Mediapipe.MpReturnCodeExtension.Assert (Mediapipe.MpReturnCode code) [0x00000] in <00000000000000000000000000000000>:0 
2022/02/09 13:40:03.277 25110 25150 Error Unity   at Mediapipe.Unity.Bootstrap+<Start>d__17.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 
2022/02/09 13:40:03.277 25110 25150 Error Unity   at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00000] in <00000000000000000000000000000000>:0 
2022/02/09 13:40:03.277 25110 25150 Error Unity 
2022/02/09 13:40:03.283 25110 25150 Info Unity PoseTrackingGraph: Using OpenGLES config
2022/02/09 13:40:03.283 25110 25150 Info Unity Mediapipe.Unity.MemoizedLogger:Log(LogLevel, String, Object)
2022/02/09 13:40:03.283 25110 25150 Info Unity Mediapipe.Unity.<Initialize>d__35:MoveNext()

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
homulercommented, Feb 9, 2022

Bootstrap includes code that must be run only once (e.g. GpuManager.Initialize). But this is not the case if instances of GpuResources and GlCalculatorHelper are destroyed before switching scenes.

0reactions
Arham-Aalamcommented, Feb 10, 2022

It worked! Sharing some comments if anybody faces the same issue:

  • Make sure Bootstrap and Image Source GameObjects are added in your main scene only.
  • Never remove the DontDestroyOnLoad methods called in BootStrap.
  • Every graph solution looks for the Bootstrap and Image Source GameObjects in the scene to load and start the graph.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Reduce Drift in 3-D Visual Odometry Trajectory Using ...
This example shows how to reduce the drift in the estimated trajectory (location and orientation) of a monocular camera using 3-D pose graph...
Read more >
A pose-graph representation of a SLAM process. Every ...
A pose-graph representation of a SLAM process. Every node in the graph corresponds to a robot pose. Nearby poses are connected by edges...
Read more >
Cocos Creator 3.8 Manual - Pose Graph
Pose graph are node graph that express the creation and transformation of a pose, and are the central building blocks for realizing procedural...
Read more >
Filtered pose graph for efficient kinect pose reconstruction
In this paper, we propose a new pose reconstruction method based on modelling the pose database with a structure called Filtered Pose Graph, ......
Read more >
Ch. 4 - Geometric Pose Estimation
In this dish-loading testbed at TRI where we put a total of eight cameras into the scene (it still doesn't resolve the occlusion...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found