Hello MediaPipe community,
I have two questions.
- I'd like to pass previous landmarks of the MediaPipe Hand model output manually each time. Optionally, if not set manually, they should be taken by default from the previous output automatically. How to achieve this? I'm writing in C++.
I noticed that if I set the "num_hands" constant to 2, the runtime doubles - why? (This is a side question.) To alleviate such performance degradation, I first set "num_hands" to 2, then, when the right hand is found, I set "num_hands" to 1 and in the "prev_landmarks" input_side_packet (not shown here because I don't know how to implement this) I pass only the landmarks of the right hand from a previous frame. By doing so I suspect that MediaPipe HandLandmarks will pick the correct hand - the right hand, in this case.
- How to set the "num_hands" dynamically rather than hardcoded in the protobuf? I set
input_side_packet: "NUM_HANDS:num_hands"in the pbtxt and then in the code
constexpr char kNumHands[] = "num_hands";
int num_hands = 1;
MP_RETURN_IF_ERROR(graph.AddPacketToInputStream(
kNumHands,
mediapipe::Adopt(&num_hands).At(mediapipe::Timestamp(frame_timestamp_us)))
);
But what I get is a core dump with no description.