-2

I'm trying to build MediaPipe from source with Bazel on Linux ubuntu 22.04. here are the full steps ive done so far:

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

but it's always failing with the following error:

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

I tried to build opencv from source with cmake and it worked, the absolute path for it is usr/local/include/opencv4/opencv2 but for some reason, Bazel is unable to find it even though I tried to manually add the full path in WORKSPACE, BUILD.bazel files.

I have been stuck with this error for about a week now, does anyone have a stable solution for this?

Vertexwahn
  • 7,709
  • 6
  • 64
  • 90
  • 1
    https://developers.google.com/mediapipe/framework/getting_started/install – Vertexwahn May 04 '23 at 14:38
  • If some header file is missing, you probably didn't install the right packages / dependencies. Header files often live in the `-dev` packages, so do a web search for which package provides that file, probably it's something like opencv2-dev or so. Install that and try again. – Robert May 04 '23 at 20:51

2 Answers2

0

It was actually solved by following this guide, but for opencv setup I went with option 2 (setup_opencv.sh)

0

Mediapipe v0.10.1 GPU Version with CUDA @ Ubuntu 22.04 (22.04c):

https://github.com/riverzhou/mediapipe.git