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

Basic subscriber / event listener example #114

Open
Wayne-nulitics opened this issue Apr 1, 2021 · 1 comment
Open

Basic subscriber / event listener example #114

Wayne-nulitics opened this issue Apr 1, 2021 · 1 comment
Assignees
Labels
type:docs Improvements or additions to documentation

Comments

@Wayne-nulitics
Copy link

@homuler Thank you for explaining the purpose of this port and use of mediapipe::CalculatorGraph, that we are looking for 'n a sample code snippet in C# that subscribes to the detection/graph calculation, we've been able to "track it down" to:

public class HandTrackingGraph : DemoGraph {
private OutputStreamPoller handLandmarksStreamPoller;
...
var handLandmarks = isHandLandmarksPresent ? FetchNextHandLandmarks() : new List();
...
private void RenderAnnotation(WebCamScreenController screenController, HandTrackingValue value) {
// NOTE: input image is flipped
GetComponent().Draw(
screenController.transform, value.HandLandmarkLists, value.Handednesses, value.PalmDetections, value.PalmRects, true);
}

But how, from another scripts, can we subscribe the receive the value.HandLandmarkLists and value.Handednesses as they are being updated.

ie. we can't figure out how to subscribe to the var handLandmarks or something that provides that with handedness.

I've mapped out the basic flow through the demo as follow, just the key points, assume we can add something similar to the RenderAnnotation function?
image

We are well versed in using it in Python, and the hand_landmark detection from here https://google.github.io/mediapipe/solutions/hands.html

Any help would be appreciated.

@homuler homuler added the type:docs Improvements or additions to documentation label Apr 7, 2021
@homuler
Copy link
Owner

homuler commented Sep 26, 2021

#296 adds a working example.

graphRunner.OnPalmDetectectionsOutput.AddListener(OnPalmDetectectionsOutput);

I will add documentation on this later.

@homuler homuler self-assigned this Sep 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:docs Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants