google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
27.27k stars 5.13k forks source link

"Hello World" compilation is ok, other projects fail #4082

Closed Mik-el closed 1 year ago

Mik-el commented 1 year ago

OS Platform and Distribution

MX Linux (based on Debian 11)

Compiler version

GCC 10.2.1

Programming Language and version

C++

MediaPipe version

0.9.1

Bazel version

6.0.0 / 5.2.0

OpenCV version (if running on desktop)

4.5.1

Describe the problem

I think I correctly installed Mediapipe on Linux using the documentation. (I copied the bazelisk executable file in usr/local/bin, I installed openCV (4) with apt and I changed the opencv_linux.BUILD file accordingly).
I correctly compiled the Hello World C++ project for CPU. ( I gave the command from the documentation: bazelisk run --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/hello_world:hello_world ).
The problems are:
1) I can't run the Hello World project I just compiled. (from the same folder I give this command, but it fails: bazelisk-bin/mediapipe/examples/desktop/helloworld/hello_world_cpu )
2) I can't compile other projects. For example, if I try to compile the Iris one ( bazelisk run --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/iris_tracking:iris_tracking_cpu ) it fails, see next logs.

Could it be a "trivial" permissions problem? (for copying the bakelisk executable I opened my file manager in root mode, so I could have messed up some permissions... anyway I think everything's ok since I recursively set back all permissions to the mediapipe folder to 755 with sudo chmod -R 755 mediapipe_folder .

Complete Logs

1) Running Hello World project:
ERROR: /home/user/.cache/bazel/_bazel_user/a7f89fd2a448b8743ff95c3531f1fe45/external/linux_opencv/BUILD.bazel:2:1: name 'new_local_repository' is not defined
ERROR: /home/user/Documents/mediapipe/third_party/BUILD:186:6: no such target '@linux_opencv//:opencv': target 'opencv' not declared in package '' defined by /home/user/.cache/bazel/_bazel_user/a7f89fd2a448b8743ff95c3531f1fe45/external/linux_opencv/BUILD.bazel and referenced by '//third_party:opencv_binary'

giving the same command again, but with sudo:
ERROR: /home/user/Documents/mediapipe/mediapipe/calculators/internal/BUILD:36:11: Compiling mediapipe/calculators/internal/callback_packet_calculator.cc failed: (Exit 1): gcc failed: error executing command [...]

2) Compiling Iris detection project:
ERROR: /home/user/.cache/bazel/_bazel_user/a7f89fd2a448b8743ff95c3531f1fe45/external/linux_opencv/BUILD.bazel:2:1: name 'new_local_repository' is not defined
ERROR: /home/user/Documents/mediapipe/third_party/BUILD:186:6: no such target '@linux_opencv//:opencv': target 'opencv' not declared in package '' defined by /home/user/.cache/bazel/_bazel_user/a7f89fd2a448b8743ff95c3531f1fe45/external/linux_opencv/BUILD.bazel and referenced by '//third_party:opencv_binary'
ERROR: Analysis of target '//mediapipe/examples/desktop/iris_tracking:iris_tracking_cpu' failed; build aborted
ayushgdev commented 1 year ago

Hello @Mik-el Would you please try using the Bazel version 5.2.0? I see you are using 6.0.0 which is not officially supported by MediaPipe yet.

Mik-el commented 1 year ago

Oh my bad, If I give "bazelisk --version" it reports "6.0.0", but If I change directory from terminal and I run it from the mediapipe directory, I get "5.2.0". (From what I understand, bazelisk installed both versions, but I'm actually using v. 5.2.0 which is specified in the .bazelversion file). So the errors I posted are the same...

ayushgdev commented 1 year ago

Hello @Mik-el We could not get our hands on MX Linux Distro to reproduce this issue, however, we did try it on the closest cousin from Debian 11 family, i.e. Ubuntu 22 with OpenCV 4.5.1 after changing the opencv_linux.BUILD file.
The build completed successfully for iris tracking. The hello world example was also running without any error. Is there any more information that you can add in the reproduction steps to help us?

Mik-el commented 1 year ago

Thank you so much for your test @ayushgdev ... ...actually MX Linux could be downloaded here (2nd paragraph) and being based on Debian 11, the most similiar distro is Debian 11, not Ubuntu. MX Linux does not use systemD, I don't know if this could be the problem. Anyway I tried the same steps on Lubuntu 22 (just Ubuntu with lxle) and I get the same errors. Could it the that my opencv_linux.BUILD file is wrongly set?

# WORKSPACE
new_local_repository(
  name = "linux_opencv",
  build_file = "@//third_party:opencv_linux.BUILD",
  path = "/usr",
)

# opencv_linux.BUILD for OpenCV 4 installed from Debian package
cc_library(
  name = "opencv",
  hdrs = glob([
    # Uncomment according to your multiarch value (gcc -print-multiarch):
    #  "include/aarch64-linux-gnu/opencv4/opencv2/cvconfig.h",
    #  "include/arm-linux-gnueabihf/opencv4/opencv2/cvconfig.h",
      "include/x86_64-linux-gnu/opencv4/opencv2/cvconfig.h",
    "include/opencv4/opencv2/**/*.h*",
  ]),
  includes = [
    # Uncomment according to your multiarch value (gcc -print-multiarch):
    #  "include/aarch64-linux-gnu/opencv4/",
    #  "include/arm-linux-gnueabihf/opencv4/",
      "include/x86_64-linux-gnu/opencv4/",
    "include/opencv4/",
  ],
  linkopts = [
    "-l:libopencv_core.so",
    "-l:libopencv_calib3d.so",
    "-l:libopencv_features2d.so",
    "-l:libopencv_highgui.so",
    "-l:libopencv_imgcodecs.so",
    "-l:libopencv_imgproc.so",
    "-l:libopencv_video.so",
    "-l:libopencv_videoio.so",
  ],
)
ayushgdev commented 1 year ago

Hello @Mik-el As per the suggestion, we reproduced the issue on Debian 11 VM as well. However, both Iris and Hello World solution are building successfully. Attached are the screenshots for the build of both the solutions.

The opencv_linux.BUILD is also the same as you have mentioned above. Though we noticed one thing, you are using gcc version 10. Would you please use the version 9.3.0 and try the same?

Mik-el commented 1 year ago

Many thanks for the screenshots @ayushgdev

Ok, I installed and set GCC 9.3.0 as the default GCC, I think. I did that doing:

#install new versions of gcc and g++
sudo apt-get install gcc-9 g++-9

#remove existing alternatives
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++

#add new and old version to update-alternatives db
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 40 --slave /usr/bin/g++ g++ /usr/bin/g++-9

#choose the needed version
sudo update-alternatives --config gcc

So now when I give gcc --version I get:

gcc (Debian 9.3.0-22) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.

I then checked openCV packages with dpkg -l |grep libopencv and I get this (I can see less packages then your ones, but maybe MX Linux group them differently, as I said I installed these packages with the commands in the Mediapipe documentation).

ii  libopencv-calib3d-dev:amd64              4.5.1+dfsg-5                           amd64        development files for libopencv-calib3d4.5
ii  libopencv-calib3d4.5:amd64               4.5.1+dfsg-5                           amd64        computer vision Camera Calibration library
ii  libopencv-core-dev:amd64                 4.5.1+dfsg-5                           amd64        development files for libopencv-core4.5
ii  libopencv-core4.5:amd64                  4.5.1+dfsg-5                           amd64        computer vision core library
ii  libopencv-dnn4.5:amd64                   4.5.1+dfsg-5                           amd64        computer vision Deep neural network module
ii  libopencv-features2d-dev:amd64           4.5.1+dfsg-5                           amd64        development files for libopencv-features2d4.5
ii  libopencv-features2d4.5:amd64            4.5.1+dfsg-5                           amd64        computer vision Feature Detection and Descriptor Extraction library
ii  libopencv-flann-dev:amd64                4.5.1+dfsg-5                           amd64        development files for libopencv-flann4.5
ii  libopencv-flann4.5:amd64                 4.5.1+dfsg-5                           amd64        computer vision Clustering and Search in Multi-Dimensional spaces library
ii  libopencv-highgui-dev:amd64              4.5.1+dfsg-5                           amd64        development files for libopencv-highgui4.5
ii  libopencv-highgui4.5:amd64               4.5.1+dfsg-5                           amd64        computer vision High-level GUI and Media I/O library
ii  libopencv-imgcodecs-dev:amd64            4.5.1+dfsg-5                           amd64        development files for libopencv-imgcodecs4.5
ii  libopencv-imgcodecs4.5:amd64             4.5.1+dfsg-5                           amd64        computer vision Image Codecs library
ii  libopencv-imgproc-dev:amd64              4.5.1+dfsg-5                           amd64        development files for libopencv-imgproc4.5
ii  libopencv-imgproc4.5:amd64               4.5.1+dfsg-5                           amd64        computer vision Image Processing library
ii  libopencv-ml-dev:amd64                   4.5.1+dfsg-5                           amd64        development files for libopencv-ml4.5
ii  libopencv-ml4.5:amd64                    4.5.1+dfsg-5                           amd64        computer vision Machine Learning library
ii  libopencv-video-dev:amd64                4.5.1+dfsg-5                           amd64        development files for libopencv-video4.5
ii  libopencv-video4.5:amd64                 4.5.1+dfsg-5                           amd64        computer vision Video analysis library
ii  libopencv-videoio-dev:amd64              4.5.1+dfsg-5                           amd64        development files for libopencv-videoio4.5
ii  libopencv-videoio4.5:amd64               4.5.1+dfsg-5                           amd64        computer vision Video I/O library

Anyways if I try to run the Hello World project... it works! :) I don't think I forgot to give export GLOG_logtostderr=1 the other times... maybe the gcc version actually fixed the thing. (despite I get this 3rd warning you don't get:

WARNING: failed to create one or more convenience symlinks for prefix 'bazel-':
  cannot create symbolic link bazel-bin -> /home/user/.cache/bazel/_bazel_user/a7f89fd2a448b8743ff95c3531f1fe45/execroot/mediapipe/bazel-out/k8-fastbuild/bin:  /home/user/Documents/mediapipe/bazel-bin (Permission denied)
  cannot create symbolic link bazel-testlogs -> /home/user/.cache/bazel/_bazel_user/a7f89fd2a448b8743ff95c3531f1fe45/execroot/mediapipe/bazel-out/k8-fastbuild/testlogs:  /home/user/Documents/mediapipe/bazel-testlogs (Permission denied)
  cannot create symbolic link bazel-out -> /home/user/.cache/bazel/_bazel_user/a7f89fd2a448b8743ff95c3531f1fe45/execroot/mediapipe/bazel-out:  /home/user/Documents/mediapipe/bazel-out (Permission denied)
  cannot create symbolic link bazel-mediapipe -> /home/user/.cache/bazel/_bazel_user/a7f89fd2a448b8743ff95c3531f1fe45/execroot/mediapipe:  /home/user/Documents/mediapipe/bazel-mediapipe (Permission denied)
Target //mediapipe/examples/desktop/hello_world:hello_world up-to-date:
  /home/user/.cache/bazel/_bazel_user/a7f89fd2a448b8743ff95c3531f1fe45/execroot/mediapipe/bazel-out/k8-fastbuild/bin/mediapipe/examples/desktop/hello_world/hello_world

)

About the Iris project, I compiled it again with bazelisk build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/iris_tracking:iris_tracking_cpu --verbose_failures but it fails and I still get:

ERROR: /home/user/.cache/bazel/_bazel_user/a7f89fd2a448b8743ff95c3531f1fe45/external/linux_opencv/BUILD.bazel:2:1: name 'new_local_repository' is not defined
ERROR: /home/user/Documents/mediapipe/third_party/BUILD:186:6: no such target '@linux_opencv//:opencv': target 'opencv' not declared in package '' defined by /home/user/.cache/bazel/_bazel_user/a7f89fd2a448b8743ff95c3531f1fe45/external/linux_opencv/BUILD.bazel and referenced by '//third_party:opencv_binary'
ERROR: Analysis of target '//mediapipe/examples/desktop/iris_tracking:iris_tracking_cpu' failed; build aborted:
FAILED: Build did NOT complete successfully (0 packages loaded, 396 targets configured)
    Fetching @com_google_mediapipe_iris_landmark_tflite; fetching
ayushgdev commented 1 year ago

@Mik-el The documentation was recently updated to include a Note for Debian 11 systems specifically. Essentially, you need to install libopencv-contrib-dev as well.

$ sudo apt-get install -y libopencv-contrib-dev

Please install and then build the solution again. It should resolve the issue.

Mik-el commented 1 year ago

Thanks @ayushgdev I installed the package. I got a bazel "undeclared inclusion(s)" error but I solved it: wiped the bazel cached with a simple bazel clean --expunge (I got from here).

Now I can correctly build and run the Hello World example both in CPU and GPU mode! :)

The problem is that, if I try to compile the Iris or Hand Detection projects (CPU or GPU) I STILL get my famous error name 'new_local_repository' is not defined.... and so on

At this point, this sounds very strange. As you saw from my opencv_linux.BUILD file, the path for the new_local_repository points to "/usr". I checked the "/usr" folder in MXLinux /Debian, and is identical to the Ubuntu one. (just 2 extra folders "doc" and "man"). I even tried to install another OpenCV package libopencv-dev just hoping to solve something...

I'm new to bazel, maybe I miss something... (for example why every projects obliviously require 2 separate commands for compilation and execution, "build" and "bazel-bin", while the "Hello World" project only required a single "run" command for both things).

Anyways... any idea on what could I fix now?

Mik-el commented 1 year ago

Ok, I just tried another approach, I copied the whole mediapipe folder to another directory, this time I used the setup_opencv.sh script to compile openCV from source instead on relying on packages. The script execution seems OK! But I still get that error... :( (I also tried the build_desktop_examples.sh script instead of giving a plain compilation command, and, obliviously, same error)

Mik-el commented 1 year ago

Great news @ayushgdev ! I resulted to solve the error! :) (name 'new_local_repository' is not defined)

Basically my opencv_linux.BUILD ( posted here ) was lacking this line, for some reason: visibility = ["//visibility:public"], But I'm sure this line was not present in the untouched file when I cloned the Mediapipe repo a few days ago!...

So what does my opencv_linux.BUILD file now contain? Just its original content with the "visibility" line PLUS all the OpenCV 4 lines I uncommented. Assuming I'm using OpenCV 4.5.1, even though:

Am I getting the 3.4.19 version because I also run the setup_opencv.sh script?

Anyways, I solved the original problem, but now I'm getting a another one. If I try to compile the Iris project with sudo bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/iris_tracking:iris_tracking_cpu --verbose_failures I get this, now:

INFO: Analyzed target //mediapipe/examples/desktop/iris_tracking:iris_tracking_cpu (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/user/Scaricati/mediapipe/mediapipe/examples/desktop/iris_tracking/BUILD:48:10: Linking mediapipe/examples/desktop/iris_tracking/iris_tracking_cpu failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc @bazel-out/k8-opt/bin/mediapipe/examples/desktop/iris_tracking/iris_tracking_cpu-2.params

Use --sandbox_debug...
[...]

And if I add --sandbox_debug I get this:

INFO: Analyzed target //mediapipe/examples/desktop/iris_tracking:iris_tracking_cpu (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/user/Scaricati/mediapipe/mediapipe/examples/desktop/iris_tracking/BUILD:48:10: Linking mediapipe/examples/desktop/iris_tracking/iris_tracking_cpu failed: (Exit 1): linux-sandbox failed: error executing command 
  (cd /root/.cache/bazel/_bazel_root/311a1400d7f0d4134c179447cdba63bd/sandbox/linux-sandbox/1673/execroot/mediapipe && \
  exec env - \
    PATH=/root/.cache/bazelisk/downloads/bazelbuild/bazel-5.2.0-linux-x86_64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
    PWD=/proc/self/cwd \
    TMPDIR=/tmp \
  /root/.cache/bazel/_bazel_root/install/41b71f1bb3ce13f20cfeeb31a9357113/linux-sandbox -t 15 -w /root/.cache/bazel/_bazel_root/311a1400d7f0d4134c179447cdba63bd/sandbox/linux-sandbox/1673/execroot/mediapipe -w /tmp -w /dev/shm -D -- /usr/bin/gcc @bazel-out/k8-opt/bin/mediapipe/examples/desktop/iris_tracking/iris_tracking_cpu-2.params)
[...]

Google tells me it could just be a wrong GCC version, but as I said gcc--version returns the 9.3.0.

Any idea on how to fix it?

ayushgdev commented 1 year ago

Hi @Mik-el The issue is because MP is not able to find OpenCV . Probably need to configure the paths correctly and should work. Can you check the comments in a thread from this point onwards? It is an identical issue and seems to have been resolved.

Mik-el commented 1 year ago

Many thanks @ayushgdev , I can successfully compile the Iris project too! (both CPU and GPU mode, but exectution fails!)

To solve the compilation problem I gave dpkg -L libopencv-calib3d-dev and seeing that openCV was installed in /usr so I changed this in the WORKSPACE file:

new_local_repository(
    name = "linux_opencv",
    build_file = "@//third_party:opencv_linux.BUILD",
    path = "/usr",
) 

the execution problem I get now is this one:

I20230301 11:59:48.135877 43042 demo_run_graph_main_gpu.cc:58] Initialize the calculator graph.
E20230301 11:59:48.139570 43042 demo_run_graph_main_gpu.cc:197] Failed to run the graph: ValidatedGraphConfig Initialization failed.
No registered object with name: FaceLandmarkFrontGpu; Unable to find Calculator "FaceLandmarkFrontGpu"
No registered object with name: SplitNormalizedLandmarkListCalculator; Unable to find Calculator "SplitNormalizedLandmarkListCalculator"
No registered object with name: SplitNormalizedLandmarkListCalculator; Unable to find Calculator "SplitNormalizedLandmarkListCalculator"
No registered object with name: IrisLandmarkLeftAndRightGpu; Unable to find Calculator "IrisLandmarkLeftAndRightGpu"
No registered object with name: ConcatenateNormalizedLandmarkListCalculator; Unable to find Calculator "ConcatenateNormalizedLandmarkListCalculator"
No registered object with name: UpdateFaceLandmarksCalculator; Unable to find Calculator "UpdateFaceLandmarksCalculator"
No registered object with name: IrisAndDepthRendererGpu; Unable to find Calculator "IrisAndDepthRendererGpu"
No registered object with name: ConcatenateNormalizedLandmarkListCalculator; Unable to find Calculator "ConcatenateNormalizedLandmarkListCalculator"
ayushgdev commented 1 year ago

Hi @Mik-el I see in the description you are using bazel run... command. It is always better to build and run separately since there are different flags for each. Please use the commands below : Build

bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/iris_tracking:iris_tracking_cpu

Run

GLOG_logtostderr=1 bazel-bin/mediapipe/examples/desktop/iris_tracking/iris_tracking_cpu --calculator_graph_config_file=mediapipe/graphs/iris_tracking/iris_tracking_cpu.pbtxt
Mik-el commented 1 year ago

@ayushgdev I used bazel run for the Hello World example only, as stated in the documentation. I compiled and run the Iris project with the same commands you provided in the last post.

Build: OK!

Run: Error, this is the complete log:

I20230303 10:54:18.256213 90986 demo_run_graph_main.cc:48] Get calculator graph config contents: # MediaPipe graph that performs iris tracking on desktop with TensorFlow Lite
# on CPU.
# Used in the example in
# mediapipie/examples/desktop/iris_tracking:iris_tracking_cpu.

# CPU image. (ImageFrame)
input_stream: "input_video"

# CPU image. (ImageFrame)
output_stream: "output_video"
# Face landmarks with iris. (NormalizedLandmarkList)
output_stream: "face_landmarks_with_iris"

# Defines how many faces to detect. Iris tracking currently only handles one
# face (left and right eye), and therefore this should always be set to 1.
node {
  calculator: "ConstantSidePacketCalculator"
  output_side_packet: "PACKET:0:num_faces"
  node_options: {
    [type.googleapis.com/mediapipe.ConstantSidePacketCalculatorOptions]: {
      packet { int_value: 1 }
    }
  }
}

# Detects faces and corresponding landmarks.
node {
  calculator: "FaceLandmarkFrontCpu"
  input_stream: "IMAGE:input_video"
  input_side_packet: "NUM_FACES:num_faces"
  output_stream: "LANDMARKS:multi_face_landmarks"
  output_stream: "ROIS_FROM_LANDMARKS:face_rects_from_landmarks"
  output_stream: "DETECTIONS:face_detections"
  output_stream: "ROIS_FROM_DETECTIONS:face_rects_from_detections"
}

# Gets the very first and only face from "multi_face_landmarks" vector.
node {
  calculator: "SplitNormalizedLandmarkListVectorCalculator"
  input_stream: "multi_face_landmarks"
  output_stream: "face_landmarks"
  node_options: {
    [type.googleapis.com/mediapipe.SplitVectorCalculatorOptions] {
      ranges: { begin: 0 end: 1 }
      element_only: true
    }
  }
}

# Gets the very first and only face rect from "face_rects_from_landmarks"
# vector.
node {
  calculator: "SplitNormalizedRectVectorCalculator"
  input_stream: "face_rects_from_landmarks"
  output_stream: "face_rect"
  node_options: {
    [type.googleapis.com/mediapipe.SplitVectorCalculatorOptions] {
      ranges: { begin: 0 end: 1 }
      element_only: true
    }
  }
}

# Gets two landmarks which define left eye boundary.
node {
  calculator: "SplitNormalizedLandmarkListCalculator"
  input_stream: "face_landmarks"
  output_stream: "left_eye_boundary_landmarks"
  node_options: {
    [type.googleapis.com/mediapipe.SplitVectorCalculatorOptions] {
      ranges: { begin: 33 end: 34 }
      ranges: { begin: 133 end: 134 }
      combine_outputs: true
    }
  }
}

# Gets two landmarks which define right eye boundary.
node {
  calculator: "SplitNormalizedLandmarkListCalculator"
  input_stream: "face_landmarks"
  output_stream: "right_eye_boundary_landmarks"
  node_options: {
    [type.googleapis.com/mediapipe.SplitVectorCalculatorOptions] {
      ranges: { begin: 362 end: 363 }
      ranges: { begin: 263 end: 264 }
      combine_outputs: true
    }
  }
}

# Detects iris landmarks, eye contour landmarks, and corresponding rect (ROI).
node {
  calculator: "IrisLandmarkLeftAndRightCpu"
  input_stream: "IMAGE:input_video"
  input_stream: "LEFT_EYE_BOUNDARY_LANDMARKS:left_eye_boundary_landmarks"
  input_stream: "RIGHT_EYE_BOUNDARY_LANDMARKS:right_eye_boundary_landmarks"
  output_stream: "LEFT_EYE_CONTOUR_LANDMARKS:left_eye_contour_landmarks"
  output_stream: "LEFT_EYE_IRIS_LANDMARKS:left_iris_landmarks"
  output_stream: "LEFT_EYE_ROI:left_eye_rect_from_landmarks"
  output_stream: "RIGHT_EYE_CONTOUR_LANDMARKS:right_eye_contour_landmarks"
  output_stream: "RIGHT_EYE_IRIS_LANDMARKS:right_iris_landmarks"
  output_stream: "RIGHT_EYE_ROI:right_eye_rect_from_landmarks"
}

node {
  calculator: "ConcatenateNormalizedLandmarkListCalculator"
  input_stream: "left_eye_contour_landmarks"
  input_stream: "right_eye_contour_landmarks"
  output_stream: "refined_eye_landmarks"
}

node {
  calculator: "UpdateFaceLandmarksCalculator"
  input_stream: "NEW_EYE_LANDMARKS:refined_eye_landmarks"
  input_stream: "FACE_LANDMARKS:face_landmarks"
  output_stream: "UPDATED_FACE_LANDMARKS:updated_face_landmarks"
}

# Renders annotations and overlays them on top of the input images.
node {
  calculator: "IrisRendererCpu"
  input_stream: "IMAGE:input_video"
  input_stream: "FACE_LANDMARKS:updated_face_landmarks"
  input_stream: "EYE_LANDMARKS_LEFT:left_eye_contour_landmarks"
  input_stream: "EYE_LANDMARKS_RIGHT:right_eye_contour_landmarks"
  input_stream: "IRIS_LANDMARKS_LEFT:left_iris_landmarks"
  input_stream: "IRIS_LANDMARKS_RIGHT:right_iris_landmarks"
  input_stream: "NORM_RECT:face_rect"
  input_stream: "LEFT_EYE_RECT:left_eye_rect_from_landmarks"
  input_stream: "RIGHT_EYE_RECT:right_eye_rect_from_landmarks"
  input_stream: "DETECTIONS:face_detections"
  output_stream: "IRIS_LANDMARKS:iris_landmarks"
  output_stream: "IMAGE:output_video"
}

node {
  calculator: "ConcatenateNormalizedLandmarkListCalculator"
  input_stream: "updated_face_landmarks"
  input_stream: "iris_landmarks"
  output_stream: "face_landmarks_with_iris"
}
I20230303 10:54:18.257050 90986 demo_run_graph_main.cc:54] Initialize the calculator graph.
I20230303 10:54:18.262806 90986 demo_run_graph_main.cc:58] Initialize the camera or load the video.
[ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (961) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
I20230303 10:54:20.756631 90986 demo_run_graph_main.cc:79] Start running the calculator graph.
I20230303 10:54:20.761260 90986 demo_run_graph_main.cc:84] Start grabbing and processing frames.
E20230303 10:54:20.883505 90986 demo_run_graph_main.cc:154] Failed to run the graph: Graph has errors: 
Calculator::Open() for node "facelandmarkfrontcpu__facelandmarkcpu__facelandmarksmodelloader__LocalFileContentsCalculator" failed: ; Can't find file: mediapipe/modules/face_landmark/face_landmark.tflite
Calculator::Open() for node "facelandmarkfrontcpu__facedetectionshortrangecpu__facedetectionshortrange__facedetection__inferencecalculator__facelandmarkfrontcpu__facedetectionshortrangecpu__facedetectionshortrange__facedetection__InferenceCalculator" failed: ; Can't find file: mediapipe/modules/face_detection/face_detection_short_range.tflite
ayushgdev commented 1 year ago

Hi @Mik-el You can download the model files from the Model cards page. In this face detection section, you download the short range TFLite model. And in the Face Mesh section, download the Face Landmark TFLite model. Then place the files in the locations given in the error.

google-ml-butler[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

google-ml-butler[bot] commented 1 year ago

Closing as stale. Please reopen if you'd like to work on this further.

google-ml-butler[bot] commented 1 year ago

Are you satisfied with the resolution of your issue? Yes No