Ask questionsGet hand_tracking_cpu source code to extract detected hand metadata

By running this code below, I am able to get the demo app to run but, where can I get the source code so that I can get the hand metadata regarding finger positions and joints?

GLOG_logtostderr=1 bazel-bin/mediapipe/examples/desktop/hand_tracking/hand_tracking_cpu \

I will like to modify: bazel-bin/mediapipe/examples/desktop/hand_tracking/hand_tracking_cpu so I can output a file with hand metadata for sign language analysis. But this seems to be a binary file. How can I use this or integrate this with a new app?


Answer questions research506

@research506 Please look at for how to build and run multi-hand tracking example on desktop.

On desktop, you can add an output stream poller to or, such as

ASSIGN_OR_RETURN(mediapipe::OutputStreamPoller multi_hand_landmarks_poller,

to listen for output packets on a particular output stream, such as "multi_hand_landamrks" above. See for example.

Then, on every frame, check if a packet is available in the output stream:

mediapipe::Packet multi_hand_landmarks_packet;
if (!multi_hand_landmarks_poller.Next(&multi_hand_landmarks_packet)) break;
const auto& multi_hand_landmarks = multi_hand_landmarks_packet.Get<std::vector<std::vector<mediapipe::NormalizedLandmark>>>();

Note that you need a dependency on

#include "mediapipe/framework/formats/landmark.pb.h"

in the file you are modifying (and modify the corresponding rule in BUILD file as well).

And then you should be able to do what you want with these landmarks, such as print them:

int hand_index = 0;
for (const auto& hand_landmarks : multi_hand_landmarks) {
  int landmark_index = 0;
  for (const auto& landmark : hand_landmark) {
    std::cout << "[Hand<" << hand_index << ">] Landmark<" << landmark_index++ << ">: (" << landmark.x() << ", " << landmark.y() << ", " << landmark.z() << ")\n";
 std::cout << "\n";

My brother, this was the droid I was looking for. I will update this thread with a link to my repo where the code can be found. I owe you a beer


Related questions

stdout: stderr: xcodebuild: error: SDK &#34;macosx10.10&#34; cannot be located. - mediapipe hot 1
SSL certification error while downloading dependency libraries via Bazel hot 1
Build of Hello World Failed on Darwin (MacOS) hot 1
unable to run multi-hand tracking on video - mediapipe hot 1
Build of Hello World Failed on Darwin (MacOS) hot 1
Bazel build failed in Android Studio hot 1
Memory leak of facedetectioncpu example on Android (RK3399 specific) - mediapipe hot 1
Fail to pull in MediaPipe's external dependencies due to unstable internet connection hot 1
at<clinit>( hot 1
Hand Tracking Desktop GPU Build Error hot 1
ERROR: An error occurred during the fetch of repository 'bazel_skylib' hot 1
Bazel build failed to fetch Maven dependency hot 1
Is there a way to change color in real time on the hair segmentation android? - mediapipe hot 1
Running error hot 1
Hello World failed build on Raspberry Pi - mediapipe hot 1
Github User Rank List