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

Error in Unity: SetPixels32 called with invalid number of pixels in the array #288

Closed
sho1003s opened this issue Sep 19, 2021 · 2 comments
Closed
Labels
sect:sample app Issue about sample app type:bug Something isn't working

Comments

@sho1003s
Copy link

I tried to solve it all day, but I couldn't solve it, so I came to ask for help.

OS Platform and Distribution (e.g., Linux Ubuntu 20.04, WSL2):Mac OS Catalina 10.15.7
Target (e.g. desktop cpu, android arm64):desktop cpu
Bazel version:3.7.2
Python version:3.9.0
GCC/G++ version:gcc 11.2.0
Unity version:2020.3.14.f
Android NDK version (if building for Android):nothing
Xcode version (if building for iOS):nothing

I tried to run Demo and I got 2 error.


Graphics.CopyTexture called with mismatching texture sizes (src 640x480x1 dst 1280x720x1)
UnityEngine.Graphics:CopyTexture (UnityEngine.Texture,UnityEngine.Texture)
TextureFrame:CopyTexture (UnityEngine.Texture) (at Assets/Mediapipe/Samples/Scripts/ResourceManager/TextureFrame.cs:23)
WebCamScreenController:DrawScreen (TextureFrame) (at Assets/Mediapipe/Samples/Scripts/WebCamScreenController.cs:106)
FaceDetectionGraph:RenderOutput (WebCamScreenController,TextureFrame) (at Assets/Mediapipe/Samples/Graphs/FaceDetection/Scripts/FaceDetectionGraph.cs:40)


SetPixels32 called with invalid number of pixels in the array
UnityEngine.Texture2D:SetPixels32 (UnityEngine.Color32[])
TextureFrame:CopyTextureFrom (UnityEngine.WebCamTexture) (at Assets/Mediapipe/Samples/Scripts/ResourceManager/TextureFrame.cs:28)
WebCamScreenController:b__25_0 (TextureFrame) (at Assets/Mediapipe/Samples/Scripts/WebCamScreenController.cs:130)
TextureFramePool/TextureFrameRequest/<>c__DisplayClass7_0:<.ctor>b__0 (TextureFrame) (at Assets/Mediapipe/Samples/Scripts/ResourceManager/TextureFramePool.cs:122)

I think this error is connected, but I have no idea where to fix it.

Since the FPS value is displayed, I think that the processing is completed, but it is not reflected on the screen.

Could you help me please..

スクリーンショット 2021-09-20 1 46 45

@homuler
Copy link
Owner

homuler commented Sep 20, 2021

Maybe the same as #44

@homuler
Copy link
Owner

homuler commented Sep 26, 2021

Fixed by #296
If the error still occurs, please reopen it.

@homuler homuler closed this as completed Sep 26, 2021
@homuler homuler changed the title Error in Unity (try to run Demo-sample) Error in Unity: SetPixels32 called with invalid number of pixels in the array Jan 10, 2022
@homuler homuler added sect:sample app Issue about sample app type:bug Something isn't working labels Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sect:sample app Issue about sample app type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants