在Linux上构建mediapipe(Ubuntu 22.04)

mccptt67  于 2023-05-16  发布在  Linux
关注(0)|答案(1)|浏览(367)

我试图在Linux ubuntu 22.04上使用Bazel从源代码构建MediaPipe。以下是我到目前为止完成的全部步骤:

git clone https://github.com/google/mediapipe.git
cd mediapipe
bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1   mediapipe/examples/desktop/desktop/holistic_tracking:holistic_tracking_cpu

但它总是失败,并出现以下错误:

In file included from ./mediapipe/util/annotation_renderer.h:20,
                 from mediapipe/util/annotation_renderer.cc:15:
./mediapipe/framework/port/opencv_core_inc.h:18:10: fatal error: opencv2/core/version.hpp: No such file or directory
   18 | #include <opencv2/core/version.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Target //mediapipe/examples/desktop/holistic_tracking:holistic_tracking_cpu failed to build
INFO: Elapsed time: 1.284s, Critical Path: 0.88s
INFO: 110 processes: 101 internal, 9 linux-sandbox.
FAILED: Build did NOT complete successfully

我试着用cmake从源代码构建opencv,它工作了,它的绝对路径是usr/local/include/opencv 4/opencv 2,但由于某种原因,Bazel无法找到它,即使我试图在WORKSPACE,BUILD.bazel文件中手动添加完整路径。
我已经被这个错误卡住了大约一个星期了,有人有一个稳定的解决方案吗?

2skhul33

2skhul331#

它实际上是通过遵循this guide解决的,但对于opencv设置,我使用了选项2(setup_opencv.sh)

相关问题