example-mediapipe-udp icon indicating copy to clipboard operation
example-mediapipe-udp copied to clipboard

How use Mediapipe to extract position of landmarks and bounding boxe

Open dgrnd4 opened this issue 5 years ago • 5 comments

Could you please tell me how to extract those position, using mediapipe? Many thanks

dgrnd4 avatar Sep 29 '20 14:09 dgrnd4

Hi @dgrnd4 ... The my_pass_through_calculator.cc file shows how you access different features by tags (like "hand_landmarks", "palm_dectections", "hand_rect") with mediapipe.

madelinegannon avatar Sep 29 '20 14:09 madelinegannon

i have the default code of mediapipe and i want to get this information but honestly i dont understand those things:

  1. must i change all the codes as yours? if not the 1 -> 2) which file should i modify? The demo_run_graph_main.cc or something else?

i just want to print in a .txt file something like this: landmarks: positions , bounding boxe: positions

dgrnd4 avatar Sep 29 '20 15:09 dgrnd4

Yeah, I feel you ... MediaPipe's modular graph-based architecture is not particularly intuitive. I'm still discovering new things about it, too.

In this repo/tutorial, I created a new node (my_pass_through_calculator.cc) where I formatted the hand data however I wanted, and then I integrated it into the compute graph for one of their example projects (in my case, this was their hand_tracking demo). You could do something similar, but just print out the data instead of sending out over UDP.

Have you worked your way through MediaPipe's Getting Started documentation? There's a Hello World! example that is helpful. Also there's more information on how to get help from the MediaPipe team.

madelinegannon avatar Sep 29 '20 15:09 madelinegannon

Many thanks, i get it using code picked up from the mediapipe original directory to extract the position of the landmarks.

Now i need the position of the boxe so i think that i'll use you code of the my_pass_through_calculator. Many thanks

dgrnd4 avatar Sep 30 '20 11:09 dgrnd4

i'm reading now that you are using hand_tracking while i need multi_hand_tracking. Do you have any solution for this?

dgrnd4 avatar Oct 08 '20 08:10 dgrnd4