Project import generated by Copybara.
PiperOrigin-RevId: 253489161
This commit is contained in:
Vendored
+75
@@ -0,0 +1,75 @@
|
||||
# Copyright 2019 The MediaPipe Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
licenses(["notice"]) # Apache License 2.0
|
||||
|
||||
exports_files(["LICENSE"])
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@gmaven_rules//:defs.bzl", "gmaven_artifact")
|
||||
|
||||
cc_library(
|
||||
name = "opencv",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = select({
|
||||
"//mediapipe:android_x86": [
|
||||
"@android_opencv//:libopencv_x86",
|
||||
],
|
||||
"//mediapipe:android_x86_64": [
|
||||
"@android_opencv//:libopencv_x86_64",
|
||||
],
|
||||
"//mediapipe:android_armeabi": [
|
||||
"@android_opencv//:libopencv_armeabi-v7a",
|
||||
],
|
||||
"//mediapipe:android_arm": [
|
||||
"@android_opencv//:libopencv_armeabi-v7a",
|
||||
],
|
||||
"//mediapipe:android_arm64": [
|
||||
"@android_opencv//:libopencv_arm64-v8a",
|
||||
],
|
||||
"//mediapipe:macos": [
|
||||
"@macos_opencv//:opencv",
|
||||
],
|
||||
"//conditions:default": [
|
||||
"@linux_opencv//:opencv",
|
||||
],
|
||||
}),
|
||||
)
|
||||
|
||||
android_library(
|
||||
name = "android_constraint_layout",
|
||||
exports = [
|
||||
gmaven_artifact("com.android.support.constraint:constraint_layout:aar:1.0.2"),
|
||||
],
|
||||
)
|
||||
|
||||
android_library(
|
||||
name = "androidx_appcompat",
|
||||
exports = [
|
||||
gmaven_artifact("androidx.appcompat:appcompat:aar:1.0.2"),
|
||||
],
|
||||
)
|
||||
|
||||
# TODO: Get the AARs from Google's Maven Repository.
|
||||
aar_import(
|
||||
name = "camerax_core",
|
||||
aar = "camera-core-1.0.0-alpha01.aar",
|
||||
)
|
||||
|
||||
aar_import(
|
||||
name = "camera2",
|
||||
aar = "camera-camera2-1.0.0-alpha01.aar",
|
||||
)
|
||||
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
# Copyright 2019 The MediaPipe Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
exports_files(["LICENSE"])
|
||||
|
||||
cc_library(
|
||||
name = "benchmark",
|
||||
srcs = glob([
|
||||
"src/*.h",
|
||||
"src/*.cc",
|
||||
]),
|
||||
hdrs = glob(["include/benchmark/*.h"]),
|
||||
copts = ["-DHAVE_POSIX_REGEX"], # HAVE_STD_REGEX didn't work.
|
||||
includes = ["include"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
+346
@@ -0,0 +1,346 @@
|
||||
# Copyright 2019 The MediaPipe Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
exports_files(["LICENSE"])
|
||||
|
||||
config_setting(
|
||||
name = "android",
|
||||
values = {
|
||||
"crosstool_top": "//external:android/crosstool",
|
||||
},
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
config_setting(
|
||||
name = "libunwind",
|
||||
values = {
|
||||
"define": "libunwind=true",
|
||||
},
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "glog",
|
||||
srcs = [
|
||||
"config_h",
|
||||
"src/base/commandlineflags.h",
|
||||
"src/base/googleinit.h",
|
||||
"src/base/mutex.h",
|
||||
"src/demangle.cc",
|
||||
"src/demangle.h",
|
||||
"src/logging.cc",
|
||||
"src/raw_logging.cc",
|
||||
"src/signalhandler.cc",
|
||||
"src/symbolize.cc",
|
||||
"src/symbolize.h",
|
||||
"src/utilities.cc",
|
||||
"src/utilities.h",
|
||||
"src/vlog_is_on.cc",
|
||||
] + glob(["src/stacktrace*.h"]),
|
||||
hdrs = [
|
||||
"src/glog/log_severity.h",
|
||||
"src/glog/logging.h",
|
||||
"src/glog/raw_logging.h",
|
||||
"src/glog/stl_logging.h",
|
||||
"src/glog/vlog_is_on.h",
|
||||
],
|
||||
copts = [
|
||||
"-Wno-sign-compare",
|
||||
"-U_XOPEN_SOURCE",
|
||||
],
|
||||
includes = ["./src"],
|
||||
linkopts = select({
|
||||
":libunwind": ["-lunwind"],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//conditions:default": ["-lpthread"],
|
||||
":android": [],
|
||||
}),
|
||||
visibility = ["//visibility:public"],
|
||||
deps = select({
|
||||
"//conditions:default": ["@com_github_gflags_gflags//:gflags"],
|
||||
":android": [],
|
||||
}),
|
||||
)
|
||||
|
||||
genrule(
|
||||
name = "run_configure",
|
||||
srcs = [
|
||||
"README",
|
||||
"Makefile.in",
|
||||
"config.guess",
|
||||
"config.sub",
|
||||
"install-sh",
|
||||
"ltmain.sh",
|
||||
"missing",
|
||||
"libglog.pc.in",
|
||||
"src/config.h.in",
|
||||
"src/glog/logging.h.in",
|
||||
"src/glog/raw_logging.h.in",
|
||||
"src/glog/stl_logging.h.in",
|
||||
"src/glog/vlog_is_on.h.in",
|
||||
],
|
||||
outs = [
|
||||
"config.h.tmp",
|
||||
"src/glog/logging.h.tmp",
|
||||
"src/glog/raw_logging.h",
|
||||
"src/glog/stl_logging.h",
|
||||
"src/glog/vlog_is_on.h",
|
||||
],
|
||||
cmd = "$(location :configure)" +
|
||||
"&& cp -v src/config.h $(location config.h.tmp) " +
|
||||
"&& cp -v src/glog/logging.h $(location src/glog/logging.h.tmp) " +
|
||||
"&& cp -v src/glog/raw_logging.h $(location src/glog/raw_logging.h) " +
|
||||
"&& cp -v src/glog/stl_logging.h $(location src/glog/stl_logging.h) " +
|
||||
"&& cp -v src/glog/vlog_is_on.h $(location src/glog/vlog_is_on.h) ",
|
||||
tools = [
|
||||
"configure",
|
||||
],
|
||||
)
|
||||
|
||||
genrule(
|
||||
name = "config_h",
|
||||
srcs = select({
|
||||
"//conditions:default": ["config.h.tmp"],
|
||||
":android": ["config.h.android"],
|
||||
}),
|
||||
outs = ["config.h"],
|
||||
cmd = "echo select $< to be the glog config file. && cp $< $@",
|
||||
)
|
||||
|
||||
genrule(
|
||||
name = "logging_h",
|
||||
srcs = select({
|
||||
"//conditions:default": ["src/glog/logging.h.tmp"],
|
||||
":android": ["src/glog/logging.h.android"],
|
||||
}),
|
||||
outs = ["src/glog/logging.h"],
|
||||
cmd = "echo select $< to be the glog logging.h file. && cp $< $@",
|
||||
)
|
||||
|
||||
# Hardcoded android config header for glog library.
|
||||
# TODO: This is a temporary workaround. We should generate the config
|
||||
# header by running the configure script with the right target toolchain.
|
||||
ANDROID_CONFIG = """
|
||||
/* Define if glog does not use RTTI */
|
||||
/* #undef DISABLE_RTTI */
|
||||
|
||||
/* Namespace for Google classes */
|
||||
#define GOOGLE_NAMESPACE google
|
||||
|
||||
/* Define if you have the 'dladdr' function */
|
||||
#define HAVE_DLADDR
|
||||
|
||||
/* Define if you have the 'snprintf' function */
|
||||
#define HAVE_SNPRINTF
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#define HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the <execinfo.h> header file. */
|
||||
/* #undef HAVE_EXECINFO_H */
|
||||
|
||||
/* Define if you have the 'fcntl' function */
|
||||
#define HAVE_FCNTL
|
||||
|
||||
/* Define to 1 if you have the <glob.h> header file. */
|
||||
#define HAVE_GLOB_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the 'pthread' library (-lpthread). */
|
||||
/* #undef HAVE_LIBPTHREAD */
|
||||
|
||||
/* Define to 1 if you have the <libunwind.h> header file. */
|
||||
/* #undef HAVE_LIBUNWIND_H */
|
||||
|
||||
/* Define if you have google gflags library */
|
||||
/* #undef HAVE_LIB_GFLAGS */
|
||||
|
||||
/* Define if you have google gmock library */
|
||||
/* #undef HAVE_LIB_GMOCK */
|
||||
|
||||
/* Define if you have google gtest library */
|
||||
/* #undef HAVE_LIB_GTEST */
|
||||
|
||||
/* Define if you have libunwind */
|
||||
/* #undef HAVE_LIB_UNWIND */
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H
|
||||
|
||||
/* Define to disable multithreading support. */
|
||||
/* #undef NO_THREADS */
|
||||
|
||||
/* Define if the compiler implements namespaces */
|
||||
#define HAVE_NAMESPACES
|
||||
|
||||
/* Define if you have the 'pread' function */
|
||||
#define HAVE_PREAD
|
||||
|
||||
/* Define if you have POSIX threads libraries and header files. */
|
||||
#define HAVE_PTHREAD
|
||||
|
||||
/* Define to 1 if you have the <pwd.h> header file. */
|
||||
#define HAVE_PWD_H
|
||||
|
||||
/* Define if you have the 'pwrite' function */
|
||||
#define HAVE_PWRITE
|
||||
|
||||
/* Define if the compiler implements pthread_rwlock_* */
|
||||
#define HAVE_RWLOCK
|
||||
|
||||
/* Define if you have the 'sigaction' function */
|
||||
#define HAVE_SIGACTION
|
||||
|
||||
/* Define if you have the 'sigaltstack' function */
|
||||
/* #undef HAVE_SIGALTSTACK */
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <syscall.h> header file. */
|
||||
#define HAVE_SYSCALL_H
|
||||
|
||||
/* Define to 1 if you have the <syslog.h> header file. */
|
||||
#define HAVE_SYSLOG_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/syscall.h> header file. */
|
||||
#define HAVE_SYS_SYSCALL_H
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/ucontext.h> header file. */
|
||||
/* #undef HAVE_SYS_UCONTEXT_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/utsname.h> header file. */
|
||||
#define HAVE_SYS_UTSNAME_H
|
||||
|
||||
/* Define to 1 if you have the <ucontext.h> header file. */
|
||||
#define HAVE_UCONTEXT_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the <unwind.h> header file. */
|
||||
#define HAVE_UNWIND_H 1
|
||||
|
||||
/* Define if the compiler supports using expression for operator */
|
||||
#define HAVE_USING_OPERATOR
|
||||
|
||||
/* Define if your compiler has __attribute__ */
|
||||
#define HAVE___ATTRIBUTE__
|
||||
|
||||
/* Define if your compiler has __builtin_expect */
|
||||
#define HAVE___BUILTIN_EXPECT 1
|
||||
|
||||
/* Define if your compiler has __sync_val_compare_and_swap */
|
||||
#define HAVE___SYNC_VAL_COMPARE_AND_SWAP
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries. */
|
||||
|
||||
/* #undef LT_OBJDIR */
|
||||
|
||||
/* Name of package */
|
||||
/* #undef PACKAGE */
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
/* #undef PACKAGE_BUGREPORT */
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
/* #undef PACKAGE_NAME */
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
/* #undef PACKAGE_STRING */
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
/* #undef PACKAGE_TARNAME */
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
/* #undef PACKAGE_URL */
|
||||
|
||||
/* Define to the version of this package. */
|
||||
/* #undef PACKAGE_VERSION */
|
||||
|
||||
/* How to access the PC from a struct ucontext */
|
||||
/* #undef PC_FROM_UCONTEXT */
|
||||
|
||||
/* Define to necessary symbol if this constant uses a non-standard name on
|
||||
your system. */
|
||||
/* #undef PTHREAD_CREATE_JOINABLE */
|
||||
|
||||
/* The size of , as computed by sizeof. */
|
||||
#define SIZEOF_VOID_P 8
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
/* #undef STDC_HEADERS */
|
||||
|
||||
/* the namespace where STL code like vector<> is defined */
|
||||
#define STL_NAMESPACE std
|
||||
|
||||
/* Version number of package */
|
||||
/* #undef VERSION */
|
||||
|
||||
/* Stops putting the code inside the Google namespace */
|
||||
#define _END_GOOGLE_NAMESPACE_ }
|
||||
|
||||
/* Puts following code inside the Google namespace */
|
||||
#define _START_GOOGLE_NAMESPACE_ namespace google {
|
||||
"""
|
||||
|
||||
genrule(
|
||||
name = "gen_android_config",
|
||||
outs = ["config.h.android"],
|
||||
cmd = ("echo '%s' > $(location config.h.android)" % ANDROID_CONFIG),
|
||||
)
|
||||
|
||||
genrule(
|
||||
name = "generate_android_glog_logging_h",
|
||||
srcs = ["src/glog/logging.h.in"],
|
||||
outs = ["src/glog/logging.h.android"],
|
||||
cmd = ("sed -e 's/@ac_cv___attribute___noinline@/__attribute__((__noinline__))/g'" +
|
||||
" -e 's/@ac_cv___attribute___noreturn@/__attribute__((__noreturn__))/g'" +
|
||||
" -e 's/@ac_cv_have___builtin_expect@/1/g'" +
|
||||
" -e 's/@ac_cv_have___uint16@/0/g'" +
|
||||
" -e 's/@ac_cv_have_inttypes_h@/1/g'" +
|
||||
" -e 's/@ac_cv_have_libgflags@/0/g'" +
|
||||
" -e 's/@ac_cv_have_stdint_h@/1/g'" +
|
||||
" -e 's/@ac_cv_have_systypes_h@/1/g'" +
|
||||
" -e 's/@ac_cv_have_u_int16_t@/0/g'" +
|
||||
" -e 's/@ac_cv_have_uint16_t@/1/g'" +
|
||||
" -e 's/@ac_cv_have_unistd_h@/1/g'" +
|
||||
" -e 's/@ac_google_end_namespace@/}/g'" +
|
||||
" -e 's/@ac_google_namespace@/google/g'" +
|
||||
" -e 's/@ac_google_start_namespace@/namespace google {/g'" +
|
||||
" $< > $@"),
|
||||
)
|
||||
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
# Description:
|
||||
# The libyuv package provides implementation yuv image conversion, rotation
|
||||
# and scaling.
|
||||
|
||||
licenses(["notice"]) # BSD license
|
||||
|
||||
exports_files(["LICENSE"])
|
||||
|
||||
cc_library(
|
||||
name = "libyuv",
|
||||
srcs = glob(
|
||||
[
|
||||
"source/*.cc",
|
||||
"include/libyuv/*.h",
|
||||
],
|
||||
),
|
||||
hdrs = [
|
||||
"include/libyuv/compare.h",
|
||||
"include/libyuv/convert.h",
|
||||
"include/libyuv/video_common.h",
|
||||
],
|
||||
includes = ["include"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
# Description:
|
||||
# OpenCV libraries for video/image processing on Android
|
||||
|
||||
licenses(["notice"]) # BSD license
|
||||
|
||||
exports_files(["LICENSE"])
|
||||
|
||||
OPENCV_LIBRARY_NAME = "libopencv_java4.so"
|
||||
|
||||
OPENCVANDROIDSDK_NATIVELIBS_PATH = "sdk/native/libs/"
|
||||
|
||||
OPENCVANDROIDSDK_JNI_PATH = "sdk/native/jni/"
|
||||
|
||||
[cc_library(
|
||||
name = "libopencv_" + arch,
|
||||
srcs = [OPENCVANDROIDSDK_NATIVELIBS_PATH + arch + "/" + OPENCV_LIBRARY_NAME],
|
||||
hdrs = glob([
|
||||
OPENCVANDROIDSDK_JNI_PATH + "include/**/*.h",
|
||||
OPENCVANDROIDSDK_JNI_PATH + "include/**/*.hpp",
|
||||
]),
|
||||
includes = [
|
||||
OPENCVANDROIDSDK_JNI_PATH + "include",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
alwayslink = 1,
|
||||
) for arch in [
|
||||
"arm64-v8a",
|
||||
"armeabi-v7a",
|
||||
"x86",
|
||||
"x86_64",
|
||||
]]
|
||||
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
# Description:
|
||||
# OpenCV libraries for video/image processing on Linux
|
||||
|
||||
licenses(["notice"]) # BSD license
|
||||
|
||||
exports_files(["LICENSE"])
|
||||
|
||||
# The following build rule assumes that OpenCV is installed by
|
||||
# 'apt-get install libopencv-core-dev libopencv-highgui-dev \'
|
||||
# ' libopencv-imgproc-dev libopencv-video-dev' on Debian/Ubuntu.
|
||||
# If you install OpenCV separately, please modify the build rule accordingly.
|
||||
cc_library(
|
||||
name = "opencv",
|
||||
srcs = glob(
|
||||
[
|
||||
"lib/x86_64-linux-gnu/libopencv_core.so*",
|
||||
"lib/x86_64-linux-gnu/libopencv_highgui.so*",
|
||||
"lib/x86_64-linux-gnu/libopencv_imgcodecs.so*",
|
||||
"lib/x86_64-linux-gnu/libopencv_imgproc.so*",
|
||||
"lib/x86_64-linux-gnu/libopencv_video.so*",
|
||||
"lib/x86_64-linux-gnu/libopencv_videoio.so*",
|
||||
],
|
||||
),
|
||||
hdrs = glob(["include/opencv/*.h*"]),
|
||||
includes = ["include"],
|
||||
linkstatic = 1,
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
# Description:
|
||||
# OpenCV libraries for video/image processing on MacOS
|
||||
|
||||
licenses(["notice"]) # BSD license
|
||||
|
||||
exports_files(["LICENSE"])
|
||||
|
||||
# The following build rule assumes that OpenCV is installed by
|
||||
# 'brew install opencv' command on macos.
|
||||
# If you install OpenCV separately, please modify the build rule accordingly.
|
||||
cc_library(
|
||||
name = "opencv",
|
||||
srcs = glob(
|
||||
[
|
||||
"local/opt/opencv/lib/libopencv_core.dylib",
|
||||
"local/opt/opencv/lib/libopencv_highgui.dylib",
|
||||
"local/opt/opencv/lib/libopencv_imgcodecs.dylib",
|
||||
"local/opt/opencv/lib/libopencv_imgproc.dylib",
|
||||
"local/opt/opencv/lib/libopencv_video.dylib",
|
||||
"local/opt/opencv/lib/libopencv_videoio.dylib",
|
||||
],
|
||||
),
|
||||
hdrs = glob(["local/opt/opencv/include/opencv4/**/*.h*"]),
|
||||
includes = ["local/opt/opencv/include/opencv4/"],
|
||||
linkstatic = 1,
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
Reference in New Issue
Block a user