1

I'm trying to extract landmarks from Hand Detection graph while modifying demo_run_graph_main.cc.

To do so, i modified hand_tracking_desktop_live.pbtxt adding following line:

output_stream: "landmarks"

I did that because in node HandLandmarkTrackingCpu there is an output with the same name. Next, I registered output stream in demo_run_graph_main.cc and tried to extract a packet from it:

ASSIGN_OR_RETURN(mediapipe::OutputStreamPoller pollerLandmarks,
               graph.AddOutputStreamPoller("landmarks"));
...
...
LOG(INFO) << "Getting landmarks...";
mediapipe::Packet packetLandmarks;
if (!pollerLandmarks.Next(&packetLandmarks)) {
  LOG(INFO) << "ERROR";
}
LOG(INFO) << "Got landmarks!";

And that's all! Code freezes on .Next call, it doesn't output "ERROR" nor "Got landmarks!" messages. I'm quite confused, as I have no idea what to try next. If I comment out my changes and leave code as it was, it works fine.

Maybe there is some material on C++ Mediapipe API?

Mikhail
  • 48
  • 5

1 Answers1

0

this was commonly caused by proto conversion error.

Normally, you need to convert the packet to recording proto msg it really was.

for etc:

 auto& output_landmarks = poseLandmarksPacket.Get<mediapipe::NormalizedLandmarkList>();

for landmarks, it usually be normalizedLandmarkList. Be note that, this is because most mediapipe graph are for single person, or single hand.

So you just have on person landmarks, or one hand landmarks.

In your cased, you should have somewhere already taken the msg in quenen.

so it stucked.

Nicholas Jela
  • 2,540
  • 7
  • 24
  • 40