-
-
Notifications
You must be signed in to change notification settings - Fork 483
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
Pass pointer address of texture instead of colors32 #13
Comments
@homuler here there's more info about how to get the pointer adress https://docs.unity3d.com/ScriptReference/Texture.GetNativeTexturePtr.html |
@elblogbruno Thank you for reporting the issue. Currently, DemoGraph#PushInput copies GPU buffer to I'll change the code to pass the GL texture name to MediaPipe directly, but it looks difficult to do with the current architecture (because Unity has to know when to release which GL texture), so it may take time. |
Glad my comment was useful for you and that it can be implemented in the near future! Cordially |
Finally...we can now pass the texture's native pointer (or texture name) to MediaPipe (OpenGL ES only). MediaPipeUnityPlugin/Assets/MediaPipe/Examples/Scripts/DemoGraph.cs Lines 54 to 63 in 18e00a8
We can also ask MediaPipe to render the output to a Unity Texture directly (cf. OfficialDemoGPU) But in fact Memo (performance tips)
|
I can't wait to try it! Glad the idea was able to be implemented, have you noticed improvement? |
I am getting better performance (50-60fps 10ms) on OfficialDemoGPU than hand graph Record_2020-12-31-11-10-11_34f41116383684cf98aa807a41aeab0b.mp4 |
I believe the repo is awesome, but having some FPS or milliseconds improvement is a good thing to develop
So , one thing in my mind for some time is that in unity you can get the texture image pointer address and I ask if it could be passed directly,so mediapipe access it instead of Colors32 that is a very expensive operation. I simply had the idea don't know how to implement it tough.
Thanks and great job.
Bruno
The text was updated successfully, but these errors were encountered: