-
-
Notifications
You must be signed in to change notification settings - Fork 476
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
ObserveOutputStream for Hand Tracking doesn't work #682
Comments
Sorry, the document is stale. Line 16 in adb2d90
However, if you use MediaPipeUnityPlugin/Packages/com.github.homuler.mediapipe/Runtime/Scripts/Unity/OutputStream.cs Lines 141 to 148 in adb2d90
Here's a Hand Tracking sample code. MediaPipeUnityPlugin/Assets/MediaPipeUnity/Samples/Scenes/Hand Tracking/HandTrackingGraph.cs Lines 53 to 57 in adb2d90
MediaPipeUnityPlugin/Assets/MediaPipeUnity/Samples/Scenes/Hand Tracking/HandTrackingSolution.cs Line 50 in adb2d90
MediaPipeUnityPlugin/Assets/MediaPipeUnity/Samples/Scenes/Hand Tracking/HandTrackingSolution.cs Lines 103 to 106 in adb2d90
|
Thank you for the information! I'm trying to implement it, but I'm still a little lost on how to implement this event in the graph coming from the I wonder if I would necessarily have to implement three classes like in the example scene? |
Which event?
I think you can implement it in a single class. |
Thank you very much! It's working perfectly now! For those who have doubts, just use the _handLandmarksStream.AddListener(OnHandLandmarksOutput); and private void OnHandLandmarksOutput(object stream, OutputEventArgs<List<NormalizedLandmarkList>> eventArgs)
{
_handLandmarksAnnotationController.DrawLater(eventArgs.value);
} |
Hey, I'm also trying to implement the same but using hair segmentation. I have the folllowing _graph = new CalculatorGraph(_configAsset.text);
var outputHairMask = new OutputStream<ImageFramePacket, ImageFrame>(_graph, "hair_mask");
outputHairMask.AddListener(OnHandLandmarksOutput);
_graph.StartRun().AssertOk();
stopwatch.Start();
while (true)
{
_inputTexture.SetPixels32(_webCamTexture.GetPixels32(_inputPixelData));
var imageFrame = new ImageFrame(ImageFormat.Types.Format.Srgba, _width, _height, _width * 4, _inputTexture.GetRawTextureData<byte>());
var currentTimestamp = stopwatch.ElapsedTicks / (System.TimeSpan.TicksPerMillisecond / 1000);
_graph.AddPacketToInputStream("input_video", new ImageFramePacket(imageFrame, new Timestamp(currentTimestamp))).AssertOk();
yield return new WaitForEndOfFrame();
} And it runs for a couple seconds but then I get this error
|
This error occurs because the private OutputStream<ImageFramePacket, ImageFrame> outputHairMask; |
it worked. Thanks a lot |
Plugin Version or Commit ID
v.0.10.1
Unity Version
2021.3.3f1
Your Host OS
Manjaro KDE with Kernel 5.4.207-1
Target Platform
UnityEditor, Android
Description
Hey guys! First, thanks for all the support for this amazing plugin. I'm from Brazil, so my comments in the attached code are in Brazilian Portuguese, since they are test scripts before the final project for my college. So ignore them for now.
Let's go to the issue!
I was trying to build a solution for Android (OpenGLES) involving ARFoundation with Hand Tracking (specifically, the output obtained by MULTI_HAND_LANDMARKS) offered by the plugin and, as stated in #343, it is necessary to use the Asynchronous API described in Advanced Topics.
However, as shown in the images below, the
ObserveOutputStream
function is not working when I reference myHandLandmarkCallback
function as a parameter, even following the steps described in the wiki and checking the files of the "Hand Tracking" example scene.And the MediaPipe OpenGLES Graph (output "4" for MULTI_HAND_LANDMARKS):
Code to Reproduce the issue
Additional Context
No response
The text was updated successfully, but these errors were encountered: