Project import generated by Copybara.

PiperOrigin-RevId: 267460010
This commit is contained in:
MediaPipe Team 2019-09-05 14:51:00 -07:00 committed by jqtang
parent 59a398924f
commit 785d266e3f
3 changed files with 24 additions and 28 deletions

View File

@ -120,7 +120,9 @@ http_archive(
load("@org_tensorflow//tensorflow:workspace.bzl", "tf_workspace") load("@org_tensorflow//tensorflow:workspace.bzl", "tf_workspace")
tf_workspace(tf_repo_name = "org_tensorflow") tf_workspace(tf_repo_name = "org_tensorflow")
# Please run $ sudo apt-get install libopencv-dev # Please run
# $ sudo apt-get install libopencv-core-dev libopencv-highgui-dev \
# libopencv-imgproc-dev libopencv-video-dev
new_local_repository( new_local_repository(
name = "linux_opencv", name = "linux_opencv",
build_file = "@//third_party:opencv_linux.BUILD", build_file = "@//third_party:opencv_linux.BUILD",
@ -133,7 +135,7 @@ new_local_repository(
path = "/usr" path = "/usr"
) )
# Please run $ brew install opencv # Please run $ brew install opencv@3
new_local_repository( new_local_repository(
name = "macos_opencv", name = "macos_opencv",
build_file = "@//third_party:opencv_macos.BUILD", build_file = "@//third_party:opencv_macos.BUILD",

View File

@ -8,9 +8,10 @@ Note: If you plan to use TensorFlow calculators and example apps, there is a
known issue with gcc and g++ version 6.3 and 7.3. Please use other versions. known issue with gcc and g++ version 6.3 and 7.3. Please use other versions.
Note: While Mediapipe configuring TensorFlow with Python 2, if you see the Note: While Mediapipe configuring TensorFlow with Python 2, if you see the
following error: "org_tensorflow/third_party/git/git_configure.bzl", line 14, in following error:
_fail fail(("%sGit Configuration Error:%s %...)))", please install the python '"/private/var/.../org_tensorflow/third_party/git/git_configure.bzl", line 14,
future library by `$ pip install --user future ` in _fail fail(("%sGit Configuration Error:%s %...)))', please install the python
future library by `$ pip install --user future`
Choose your operating system: Choose your operating system:
@ -243,23 +244,17 @@ To build and run iOS apps:
4. Install OpenCV and FFmpeg. 4. Install OpenCV and FFmpeg.
Option 1. Use HomeBrew package manager tool to install the pre-compiled Option 1. Use HomeBrew package manager tool to install the pre-compiled
OpenCV libraries. FFmpeg will be installed via OpenCV. OpenCV 3.4.5 libraries. FFmpeg will be installed via OpenCV.
```bash ```bash
$ brew install opencv $ brew install opencv@3
# A Known issue with OpenCV 4.1.1 or above:
# If you see a missing dependency declaration error when building mediapipe target,
# you may need to uninstall glog as a temporary workaround. The error message looks like:
# ERROR: this rule is missing dependency declarations for the following files included
# by 'mediapipe/calculators/image/scale_image_utils.cc':
# '/usr/local/include/glog/logging.h'
# '/usr/local/include/glog/log_severity.h'
# '/usr/local/include/glog/vlog_is_on.h'
$ brew uninstall --ignore-dependencies glog
$ bazel clean --expunge
``` ```
Note: If you do `$brew install opencv`, there is a known issue caused by the
glog dependency of OpenCV 4.1.1 or above. The problem is solvable by
uninstalling the glog. You need to do `$ brew uninstall
--ignore-dependencies glog`
Option 2. Use MacPorts package manager tool to install the OpenCV libraries. Option 2. Use MacPorts package manager tool to install the OpenCV libraries.
```bash ```bash

View File

@ -6,23 +6,22 @@ licenses(["notice"]) # BSD license
exports_files(["LICENSE"]) exports_files(["LICENSE"])
# The following build rule assumes that OpenCV is installed by # The following build rule assumes that OpenCV is installed by
# 'brew install opencv' command on macos. # 'brew install opencv@3' command on macos.
# If you install OpenCV separately, please modify the build rule accordingly. # If you install OpenCV separately, please modify the build rule accordingly.
cc_library( cc_library(
name = "opencv", name = "opencv",
srcs = glob( srcs = glob(
[ [
"local/opt/opencv/lib/libopencv_core.dylib", "local/opt/opencv@3/lib/libopencv_core.dylib",
"local/opt/opencv/lib/libopencv_highgui.dylib", "local/opt/opencv@3/lib/libopencv_highgui.dylib",
"local/opt/opencv/lib/libopencv_imgcodecs.dylib", "local/opt/opencv@3/lib/libopencv_imgcodecs.dylib",
"local/opt/opencv/lib/libopencv_imgproc.dylib", "local/opt/opencv@3/lib/libopencv_imgproc.dylib",
"local/opt/opencv/lib/libopencv_optflow.dylib", "local/opt/opencv@3/lib/libopencv_video.dylib",
"local/opt/opencv/lib/libopencv_video.dylib", "local/opt/opencv@3/lib/libopencv_videoio.dylib",
"local/opt/opencv/lib/libopencv_videoio.dylib",
], ],
), ),
hdrs = glob(["local/opt/opencv/include/opencv4/**/*.h*"]), hdrs = glob(["local/opt/opencv@3/include/opencv2/**/*.h*"]),
includes = ["local/opt/opencv/include/opencv4/"], includes = ["local/opt/opencv@3/include/"],
linkstatic = 1, linkstatic = 1,
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
) )