Skip to content

Commit

Permalink
Project import generated by Copybara.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 7b9bc1e132660eadd313a7228d6069c5e33f8e84
  • Loading branch information
Magritte Team authored and murilolima committed Sep 5, 2022
1 parent 2c53ace commit c5d554f
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2.1
5.2.0
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## [Unreleased]

### Added
-
-

## [1.0.0]

Expand Down
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ RUN wget https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/c
rm clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz

################################################################################
# using bazel-4.2.1
# using bazel-5.2.0
################################################################################
WORKDIR /bin
RUN wget https://github.com/bazelbuild/bazel/releases/download/4.2.1/bazel-4.2.1-linux-x86_64 && \
mkdir bazel-4.2.1 && \
mv bazel-4.2.1-linux-x86_64 bazel-4.2.1/bazel && \
chmod +x bazel-4.2.1/bazel
RUN wget https://github.com/bazelbuild/bazel/releases/download/5.2.0/bazel-5.2.0-linux-x86_64 && \
mkdir bazel-5.2.0 && \
mv bazel-5.2.0-linux-x86_64 bazel-5.2.0/bazel && \
chmod +x bazel-5.2.0/bazel

################################################################################
# using ndk-r21e
Expand Down Expand Up @@ -176,7 +176,7 @@ RUN wget https://sourceforge.net/projects/doxygen/files/rel-1.8.18/doxygen-1.8.1
################################################################################
# Toolchain environment scripts
################################################################################
RUN ln -s /bin/bazel-4.2.1/bazel /bin/bazel
RUN ln -s /bin/bazel-5.2.0/bazel /bin/bazel

################################################################################
# Magritte Requirements
Expand All @@ -203,4 +203,4 @@ RUN groupadd --gid "${gid}" "${groupname}" \

USER "${username}"

LABEL Name=ubuntu-build Version=0.0.7
LABEL Name=ubuntu-build Version=0.0.8
32 changes: 18 additions & 14 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ workspace(name = "magritte")
# Load http_archive statement
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# Pin to mediapipe GitHub version (latest as of 2022-02-04 is 0.8.9)
# Pin to mediapipe GitHub version (latest as of 2022-09-01 is 0.8.10.2)
http_archive(
name = "mediapipe",
urls = ["https://github.com/google/mediapipe/archive/refs/tags/v0.8.9.tar.gz"],
sha256 = "54ce6da9f167d34fe53f928c804b3bc1fd1dd8fe2b32ca4bf0b63325d34680ac",
strip_prefix = "mediapipe-0.8.9",
urls = ["https://github.com/google/mediapipe/archive/refs/tags/v0.8.10.2.tar.gz"],
sha256 = "a312bf8e69dbe34d3b5c7ea226dcc122aa9e640cbfbf35e1be65d0150b35f1e5",
strip_prefix = "mediapipe-0.8.10.2",
)
# ------------- Begin mediapipe dependencies ----------------

Expand Down Expand Up @@ -66,8 +66,9 @@ http_archive(

http_archive(
name = "rules_cc",
strip_prefix = "rules_cc-0.0.1",
urls = ["https://github.com/bazelbuild/rules_cc/archive/refs/tags/0.0.1.zip"],
strip_prefix = "rules_cc-2f8c04c04462ab83c545ab14c0da68c3b4c96191",
# The commit can be updated if the build passes. Last updated 6/23/22.
urls = ["https://github.com/bazelbuild/rules_cc/archive/2f8c04c04462ab83c545ab14c0da68c3b4c96191.zip"],
)

http_archive(
Expand All @@ -92,11 +93,12 @@ http_archive(
sha256 = "de682ea824bfffba05b4e33b67431c247397d6175962534305136aa06f92e049",
)

# Google Benchmark library.
# Google Benchmark library v1.6.1 released on 2022-01-10.
http_archive(
name = "com_google_benchmark",
urls = ["https://github.com/google/benchmark/archive/refs/tags/v1.6.1.zip"],
strip_prefix = "benchmark-v1.6.1.zip",
urls = ["https://github.com/google/benchmark/archive/refs/tags/v1.6.1.tar.gz"],
strip_prefix = "benchmark-1.6.1",
sha256 = "6132883bc8c9b0df5375b16ab520fac1a85dc9e4cf5be59480448ece74b278d4",
build_file = "@mediapipe//third_party:benchmark.BUILD",
)

Expand Down Expand Up @@ -232,7 +234,10 @@ new_local_repository(
new_local_repository(
name = "macos_opencv",
build_file = "@mediapipe//third_party:opencv_macos.BUILD",
path = "/usr/local/opt/opencv@3",
# For local MacOS builds, the path should point to an opencv@3 installation.
# If you edit the path here, you will also need to update the corresponding
# prefix in "opencv_macos.BUILD".
path = "/usr/local",
)

new_local_repository(
Expand Down Expand Up @@ -404,17 +409,16 @@ http_archive(
)

# Tensorflow repo should always go after the other external dependencies.
# 2021-12-02
_TENSORFLOW_GIT_COMMIT = "18a1dc0ba806dc023808531f0373d9ec068e64bf"
_TENSORFLOW_SHA256 = "85b90416f7a11339327777bccd634de00ca0de2cf334f5f0727edcb11ff9289a"
# 2022-02-15
_TENSORFLOW_GIT_COMMIT = "a3419acc751dfc19caf4d34a1594e1f76810ec58"
_TENSORFLOW_SHA256 = "b95b2a83632d4055742ae1a2dcc96b45da6c12a339462dbc76c8bca505308e3a"
http_archive(
name = "org_tensorflow",
urls = [
"https://github.com/tensorflow/tensorflow/archive/%s.tar.gz" % _TENSORFLOW_GIT_COMMIT,
],
patches = [
"@mediapipe//third_party:org_tensorflow_compatibility_fixes.diff",
"@mediapipe//third_party:org_tensorflow_objc_cxx17.diff",
# Diff is generated with a script, don't update it manually.
"@mediapipe//third_party:org_tensorflow_custom_ops.diff",
],
Expand Down
4 changes: 3 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ library.
* First release to GitHub.
* New graphs: face blurring, face overlay, face pixelization, face sticker
redaction.
* Magritte library API that simplifies common tasks by providing abstractions
around the use of MediaPipe in many places.
* Added Android and desktop example apps.
* Added documentation.
* Added documentation and C++ codelab.
4 changes: 2 additions & 2 deletions docs/getting_started/demos.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ We also provide a
[`Dockerfile`](https://github.com/google/magritte/blob/main/Dockerfile)
with all dependencies installed.

### Install Bazel 4.2.1
### Install Bazel 5.2.0
Follow the
[Bazel documentation](https://docs.bazel.build/versions/master/install-ubuntu.html#install-on-ubuntu)
to install Bazel from its apt repository. Make sure you use version 4.2.1.
to install Bazel from its apt repository. Make sure you use version 5.2.0.

Another option is to
[install Bazelisk](https://docs.bazel.build/versions/main/install-bazelisk.html),
Expand Down
2 changes: 1 addition & 1 deletion magritte/magritte_graph.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def _magritte_resources_folder_impl(ctx):
output_folder = ctx.attr.name
created_files = []
for file in ctx.files.runtime_data:
relative_path = file.path.replace("external/mediapipe/", "")
relative_path = file.path.removeprefix("external/mediapipe/")
output_file = ctx.actions.declare_file(paths.join(output_folder, relative_path))
created_files.append(output_file)
if ctx.attr.is_windows:
Expand Down
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ set -e
# Display commands being run.
set -x

using bazel-4.2.1
using bazel-5.2.0
using cmake-3.17.2
using clang-10.0.0
using ndk-r21e
Expand Down
2 changes: 1 addition & 1 deletion test_android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ set -e
# Display commands being run.
set -x

using bazel-4.2.1
using bazel-5.2.0
using cmake-3.17.2
using clang-10.0.0
using ndk-r21e
Expand Down
2 changes: 1 addition & 1 deletion test_android_simplified.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ set -e
# Display commands being run.
set -x

using bazel-4.2.1
using bazel-5.2.0
using cmake-3.17.2
using clang-10.0.0
using ndk-r21e
Expand Down

0 comments on commit c5d554f

Please sign in to comment.