asprecic / mediapipe-qt-integration-example

Example Qt application that demonstrates how to integrate Mediapipe
MIT License
48 stars 5 forks source link

Where to put mediapipe/modules? #5

Closed Billccx closed 2 years ago

Billccx commented 2 years ago

Hello! In README, you mentioned that:

Create mediapipe directory wherever the final binary of build is, 
and copy mediapipe/modules and mediapipe/models to it. 
In these folders, .tflite models can be found, 
without which example can't run. (poller will not return packets)

Could you please explain where is "the final binary" more clearly?

I haved tried to put these two folders in the folder of .so file and the Qt build folder, but both got wrong.

"poselandmarkcpu_1__posedetectioncpu__inferencecalculator__poselandmarkcpu_1__posedetectioncpu__InferenceCalculator" failed: ; Can't find file: mediapipe/modules/pose_detection/pose_detection.tflite
Calculator::Open() for node

I am looking forward to your reply! Thanks in advance.

asprecic commented 2 years ago

Compiling this example will yield you an executable binary file. You can find where this build output is in QtCreator by going to Build Settings and seeing what is under Build directory. The modules and models directories should be in the same directory where this executable binary is. You mentioned that you tried putting it in the Qt build folder, so that should've worked.

asprecic commented 2 years ago

EDIT: Github edits the whitespace in the comments, here's a pastebin of how it looks like properly: https://pastebin.com/raw/vrfw1NKA This is what the directories looks like in my Qt build folder: user@pc:~/projects/build-MediapipeExample-Desktop_Qt_5_12_10_GCC_64bit-Debug$ tree . ├── graphs.o ├── imagerenderer.o ├── main.o ├── Makefile ├── mediapipe │   ├── models │   │   ├── BUILD │   │   ├── hair_segmentation.tflite │   │   ├── knift_float_1k.tflite │   │   ├── knift_float_400.tflite │   │   ├── knift_float.tflite │   │   ├── knift_index.pb │   │   ├── knift_labelmap.txt │   │   ├── object_detection_saved_model │   │   │   ├── model.ckpt.data-00000-of-00001 │   │   │   ├── model.ckpt.index │   │   │   ├── model.ckpt.meta │   │   │   ├── pipeline.config │   │   │   ├── README.md │   │   │   └── saved_model.pb │   │   ├── README.md │   │   ├── ssdlite_object_detection_labelmap.txt │   │   └── ssdlite_object_detection.tflite

│   └── modules │   ├── face_detection │   ├── face_geometry │   ├── face_landmark │   ├── hand_landmark │   ├── holistic_landmark │   ├── iris_landmark │   ├── objectron │   ├── palm_detection │   ├── pose_detection │   ├── pose_landmark │   └── selfie_segmentation ├── MediapipeExample ├── moc_graphs.cpp ├── moc_graphs.o ├── moc_imagerenderer.cpp ├── moc_imagerenderer.o ├── moc_mpintegrationexample.cpp ├── moc_mpintegrationexample.o ├── moc_predefs.h ├── mpintegrationexample.o ├── qrc_qml.cpp └── qrc_qml.o