Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to read texture using CPU when another window takes focus #1269

Open
AndreAhmed opened this issue Oct 29, 2024 · 3 comments
Open

Failed to read texture using CPU when another window takes focus #1269

AndreAhmed opened this issue Oct 29, 2024 · 3 comments
Assignees
Labels
type:bug Something isn't working

Comments

@AndreAhmed
Copy link

Plugin Version or Commit ID

v0.15.0

Unity Version

2022

Your Host OS

Windows

Target Platform

Windows Standalone

Target Device

RTX4060

[Windows Only] Visual Studio C++ and Windows SDK Version

ff

[Linux Only] GCC/G++ and GLIBC Version

ff

[Android Only] Android Build Tools and NDK Version

ff

[iOS Only] XCode Version

ff

Build Command

UnityEditor

Bug Description

When I try to use CPU Mode for reading mediapipe from image, texture, or anything, and when I lose the focus of Unity window to another window like chrome, I get the following exception

image

Steps to Reproduce the Bug

f

Log

No log on windows

Screenshot/Video

image

Additional Context

No response

@AndreAhmed AndreAhmed added the type:bug Something isn't working label Oct 29, 2024
@AndreAhmed
Copy link
Author

any solution?

@AndreAhmed
Copy link
Author

@homuler

@homuler
Copy link
Owner

homuler commented Nov 20, 2024

Please try this.

diff --git a/Assets/MediaPipeUnity/Samples/Scenes/Pose Landmark Detection/PoseLandmarkerRunner.cs b/Assets/MediaPipeUnity/Samples/Scenes/Pose Landmark Detection/PoseLandmarkerRunner.cs
index 3072fdc..d93cf1e 100644
--- a/Assets/MediaPipeUnity/Samples/Scenes/Pose Landmark Detection/PoseLandmarkerRunner.cs
+++ b/Assets/MediaPipeUnity/Samples/Scenes/Pose Landmark Detection/PoseLandmarkerRunner.cs
@@ -107,8 +107,9 @@ namespace Mediapipe.Unity.Sample.PoseLandmarkDetection

           if (req.hasError)
           {
-            Debug.LogError($"Failed to read texture from the image source, exiting...");
-            break;
+            Debug.LogWarning($"Failed to read texture from the image source");
+            yield return new WaitForEndOfFrame();
+            continue;
           }
           image = textureFrame.BuildCPUImage();
           textureFrame.Release();

@homuler homuler self-assigned this Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants