purgeme / mediapipe_cpp_lib

Apache License 2.0
16 stars 1 forks source link

Some questions about the details of how to use this lib. #4

Open LiuYi-Up opened 1 year ago

LiuYi-Up commented 1 year ago

Hello, thank you for your great work.

I'm a green hand of making c++ project. So after I following your guide of building the lib, I still have some questions bellow:

  1. if I wanna use it in my c++ project, is there any file I should copy to my project folder ?
  2. or I just need add the path to LD_LIBRARY_PATH?
  3. how I make the lib to cmake file in my project?

Hope your reply~Best wishes!

purgeme commented 1 year ago
  1. There are two python scripts, one to extract graph files from the mediapipe repo and other to download the tensorflow models. After you run those scripts you will have 2 folders: mediapipe_graphs and mediapipe_models, you should place the models folder where you executable resides as the path for that is hard coded into the library. For the graph, you can place that as you wish as you enter their path in your code.

There is also the protobuf thing, you will need version 3.19.1 as of now, you can either install this version to your system or use it locally, if you use it locally you will need the library files. My suggestion would be to use distrobox for linux, makes development quit a bit easier without messing the main system.

  1. Rather than adding path to LD_LIBRARY_PATH you can also use the rpath, whatever floats your boat.

  2. It's basically a dynamic library so you can use it like any other library, you just need the graphs and model files on top. I think you should be able to easily incorporate them into cmake, though I haven't tried cmake with this myself.

I will be happy to help if you have any other questions.

LiuYi-Up commented 1 year ago
  1. There are two python scripts, one to extract graph files from the mediapipe repo and other to download the tensorflow models. After you run those scripts you will have 2 folders: mediapipe_graphs and mediapipe_models, you should place the models folder where you executable resides as the path for that is hard coded into the library. For the graph, you can place that as you wish as you enter their path in your code.

There is also the protobuf thing, you will need version 3.19.1 as of now, you can either install this version to your system or use it locally, if you use it locally you will need the library files. My suggestion would be to use distrobox for linux, makes development quit a bit easier without messing the main system.

  1. Rather than adding path to LD_LIBRARY_PATH you can also use the rpath, whatever floats your boat.
  2. It's basically a dynamic library so you can use it like any other library, you just need the graphs and model files on top. I think you should be able to easily incorporate them into cmake, though I haven't tried cmake with this myself.

I will be happy to help if you have any other questions.

Receiving your reply is the beginning of a wonderful day!This is very helpful for me.Thank you!