Skip to content

Commit

Permalink
build!: MediaPipe v0.8.8 (#356)
Browse files Browse the repository at this point in the history
* build: upgrade mediapipe to 0.8.8

* fix: resolve compile errors

* build: upgrade unity (2020.3.23f1)

* doc: update Unity and MediaPipe version
  • Loading branch information
homuler committed Nov 20, 2021
1 parent a9edb9e commit c603366
Show file tree
Hide file tree
Showing 12 changed files with 125 additions and 258 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ public GlTexture() : base()
this.ptr = ptr;
}

public GlTexture(uint name, int width, int height) : base()
{
UnsafeNativeMethods.mp_GlTexture__ui_i_i(name, width, height, out var ptr).Assert();
this.ptr = ptr;
}

public GlTexture(IntPtr ptr, bool isOwner = true) : base(ptr, isOwner) { }

protected override void DeleteMpPtr()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ internal static partial class UnsafeNativeMethods
[DllImport(MediaPipeLibrary, ExactSpelling = true)]
public static extern MpReturnCode mp_GlTexture__(out IntPtr glTexture);

[DllImport(MediaPipeLibrary, ExactSpelling = true)]
public static extern MpReturnCode mp_GlTexture__ui_i_i(uint name, int width, int height, out IntPtr glTexture);

[DllImport(MediaPipeLibrary, ExactSpelling = true)]
public static extern void mp_GlTexture__delete(IntPtr glTexture);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,6 @@ public void Ctor_ShouldInstantiateGlTexture_When_CalledWithNoArguments()
Assert.AreEqual(glTexture.height, 0);
}
}

[Test, GpuOnly]
public void Ctor_ShouldInstantiateGlTexture_When_CalledWithNameAndSize()
{
using (var glTexture = new GlTexture(1, 100, 100))
{
Assert.AreEqual(glTexture.name, 1);
Assert.AreEqual(glTexture.width, 100);
Assert.AreEqual(glTexture.height, 100);
}
}
#endregion

#region #isDisposed
Expand Down
18 changes: 9 additions & 9 deletions Packages/manifest.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"dependencies": {
"com.unity.2d.animation": "5.0.4",
"com.unity.2d.animation": "5.0.9",
"com.unity.2d.pixel-perfect": "4.0.1",
"com.unity.2d.psdimporter": "4.0.2",
"com.unity.2d.psdimporter": "4.1.2",
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.spriteshape": "5.1.1",
"com.unity.2d.spriteshape": "5.1.5",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.collab-proxy": "1.3.9",
"com.unity.collab-proxy": "1.15.1",
"com.unity.ide.rider": "2.0.7",
"com.unity.ide.visualstudio": "2.0.7",
"com.unity.ide.vscode": "1.2.3",
"com.unity.ide.visualstudio": "2.0.11",
"com.unity.ide.vscode": "1.2.4",
"com.unity.mathematics": "1.2.1",
"com.unity.settings-manager": "1.0.3",
"com.unity.test-framework": "1.1.24",
"com.unity.test-framework": "1.1.29",
"com.unity.testtools.codecoverage": "1.0.0",
"com.unity.textmeshpro": "3.0.1",
"com.unity.timeline": "1.4.7",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.4.8",
"com.unity.toolchain.linux-x86_64": "0.1.18-preview",
"com.unity.toolchain.macos-x86_64-linux-x86_64": "0.1.22-preview",
"com.unity.ugui": "1.0.0",
Expand Down
47 changes: 33 additions & 14 deletions Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dependencies": {}
},
"com.unity.2d.animation": {
"version": "5.0.4",
"version": "5.0.9",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -30,7 +30,7 @@
"url": "https://packages.unity.com"
},
"com.unity.2d.path": {
"version": "4.0.1",
"version": "4.0.2",
"depth": 1,
"source": "registry",
"dependencies": {},
Expand All @@ -44,12 +44,12 @@
"url": "https://packages.unity.com"
},
"com.unity.2d.psdimporter": {
"version": "4.0.2",
"version": "4.1.2",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.2d.common": "4.0.2",
"com.unity.2d.animation": "5.0.2",
"com.unity.2d.common": "4.0.3",
"com.unity.2d.animation": "5.0.9",
"com.unity.2d.sprite": "1.0.0"
},
"url": "https://packages.unity.com"
Expand All @@ -61,13 +61,13 @@
"dependencies": {}
},
"com.unity.2d.spriteshape": {
"version": "5.1.1",
"version": "5.1.5",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.mathematics": "1.1.0",
"com.unity.2d.common": "4.0.3",
"com.unity.2d.path": "4.0.1",
"com.unity.2d.path": "4.0.2",
"com.unity.modules.physics2d": "1.0.0"
},
"url": "https://packages.unity.com"
Expand All @@ -79,10 +79,13 @@
"dependencies": {}
},
"com.unity.collab-proxy": {
"version": "1.3.9",
"version": "1.15.1",
"depth": 0,
"source": "registry",
"dependencies": {},
"dependencies": {
"com.unity.nuget.newtonsoft-json": "2.0.0",
"com.unity.services.core": "1.0.1"
},
"url": "https://packages.unity.com"
},
"com.unity.ext.nunit": {
Expand All @@ -102,7 +105,7 @@
"url": "https://packages.unity.com"
},
"com.unity.ide.visualstudio": {
"version": "2.0.7",
"version": "2.0.11",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -111,7 +114,7 @@
"url": "https://packages.unity.com"
},
"com.unity.ide.vscode": {
"version": "1.2.3",
"version": "1.2.4",
"depth": 0,
"source": "registry",
"dependencies": {},
Expand All @@ -124,6 +127,22 @@
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.nuget.newtonsoft-json": {
"version": "2.0.0",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.services.core": {
"version": "1.0.1",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.settings-manager": {
"version": "1.0.3",
"depth": 0,
Expand All @@ -148,7 +167,7 @@
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.24",
"version": "1.1.29",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -169,7 +188,7 @@
"url": "https://packages.unity.com"
},
"com.unity.textmeshpro": {
"version": "3.0.1",
"version": "3.0.6",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -178,7 +197,7 @@
"url": "https://packages.unity.com"
},
"com.unity.timeline": {
"version": "1.4.7",
"version": "1.4.8",
"depth": 0,
"source": "registry",
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 2020.3.8f1
m_EditorVersionWithRevision: 2020.3.8f1 (507919d4fff5)
m_EditorVersion: 2020.3.23f1
m_EditorVersionWithRevision: 2020.3.23f1 (c5d91304a876)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MediaPipe Unity Plugin

This is a Unity (2020.3.8f1) Plugin to use MediaPipe (0.8.6).
This is a Unity (2020.3.23f1) Plugin to use MediaPipe (0.8.8).

## Prerequisites

Expand Down
76 changes: 46 additions & 30 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ rules_pkg_dependencies()
new_local_repository(
name = "unity",
build_file = "@//third_party:unity.BUILD",
path = "/path/to/unity/2020.3.8f1",
path = "/path/to/unity/2020.3.23f1",
)

# mediapipe
Expand All @@ -59,12 +59,12 @@ http_archive(
"@//third_party:mediapipe_model_path.diff",
"@//third_party:mediapipe_extension.diff",
],
sha256 = "3fa1548474d8ef943361804a9f86a3edaa00b0976b9d58fd3b41092d339053c6",
strip_prefix = "mediapipe-0.8.6",
urls = ["https://github.com/google/mediapipe/archive/v0.8.6.tar.gz"],
sha256 = "d20c4c7a957c70be6018c704a5cea3c61314df22e4f88b452c19472f0227a48f",
strip_prefix = "mediapipe-0.8.8",
urls = ["https://github.com/google/mediapipe/archive/v0.8.8.tar.gz"],
)

# ABSL cpp library lts_2020_09_23
# ABSL cpp library lts_2021_03_24, patch 2.
http_archive(
name = "com_google_absl",
patch_args = [
Expand All @@ -74,10 +74,10 @@ http_archive(
patches = [
"@com_google_mediapipe//third_party:com_google_absl_f863b622fe13612433fdf43f76547d5edda0c93001.diff",
],
sha256 = "b3744a4f7a249d5eaf2309daad597631ce77ea62e0fc6abffbab4b4c3dc0fc08",
strip_prefix = "abseil-cpp-20200923",
sha256 = "59b862f50e710277f8ede96f083a5bb8d7c9595376146838b9580be90374ee1f",
strip_prefix = "abseil-cpp-20210324.2",
urls = [
"https://github.com/abseil/abseil-cpp/archive/20200923.tar.gz",
"https://github.com/abseil/abseil-cpp/archive/refs/tags/20210324.2.tar.gz",
],
)

Expand All @@ -99,19 +99,12 @@ load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_depende
rules_foreign_cc_dependencies()

# GoogleTest/GoogleMock framework. Used by most unit-tests.
# Last updated 2020-06-30.
# Last updated 2021-07-02.
http_archive(
name = "com_google_googletest",
patch_args = [
"-p1",
],
patches = [
# fix for https://github.com/google/googletest/issues/2817
"@com_google_mediapipe//third_party:com_google_googletest_9d580ea80592189e6d44fa35bcf9cdea8bf620d6.diff",
],
sha256 = "04a1751f94244307cebe695a69cc945f9387a80b0ef1af21394a490697c5c895",
strip_prefix = "googletest-aee0f9d9b5b87796ee8a0ab26b7587ec30e8858e",
urls = ["https://github.com/google/googletest/archive/aee0f9d9b5b87796ee8a0ab26b7587ec30e8858e.zip"],
sha256 = "de682ea824bfffba05b4e33b67431c247397d6175962534305136aa06f92e049",
strip_prefix = "googletest-4ec4cd23f486bf70efcc5d2caa40f24368f752e3",
urls = ["https://github.com/google/googletest/archive/4ec4cd23f486bf70efcc5d2caa40f24368f752e3.zip"],
)

# Google Benchmark library.
Expand Down Expand Up @@ -211,11 +204,11 @@ http_archive(
http_archive(
name = "pybind11",
build_file = "@pybind11_bazel//:pybind11.BUILD",
sha256 = "1eed57bc6863190e35637290f97a20c81cfe4d9090ac0a24f3bbf08f265eb71d",
strip_prefix = "pybind11-2.4.3",
sha256 = "616d1c42e4cf14fa27b2a4ff759d7d7b33006fdc5ad8fd603bb2c22622f27020",
strip_prefix = "pybind11-2.7.1",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/pybind/pybind11/archive/v2.4.3.tar.gz",
"https://github.com/pybind/pybind11/archive/v2.4.3.tar.gz",
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/pybind/pybind11/archive/v2.7.1.tar.gz",
"https://github.com/pybind/pybind11/archive/v2.7.1.tar.gz",
],
)

Expand Down Expand Up @@ -389,7 +382,10 @@ load("@rules_jvm_external//:defs.bzl", "maven_install")
maven_install(
artifacts = [
"androidx.concurrent:concurrent-futures:1.0.0-alpha03",
"androidx.lifecycle:lifecycle-common:2.2.0",
"androidx.lifecycle:lifecycle-common:2.3.1",
"androidx.activity:activity:1.2.2",
"androidx.exifinterface:exifinterface:1.3.3",
"androidx.fragment:fragment:1.3.4",
"androidx.annotation:annotation:aar:1.1.0",
"androidx.appcompat:appcompat:aar:1.1.0-rc01",
"androidx.camera:camera-core:1.0.0-beta10",
Expand All @@ -404,9 +400,9 @@ maven_install(
"com.google.android.material:material:aar:1.0.0-rc01",
"com.google.auto.value:auto-value:1.8.1",
"com.google.auto.value:auto-value-annotations:1.8.1",
"com.google.code.findbugs:jsr305:3.0.2",
"com.google.flogger:flogger-system-backend:0.3.1",
"com.google.flogger:flogger:0.3.1",
"com.google.code.findbugs:jsr305:latest.release",
"com.google.flogger:flogger-system-backend:0.6",
"com.google.flogger:flogger:0.6",
"com.google.guava:guava:27.0.1-android",
"com.google.guava:listenablefuture:1.0",
"junit:junit:4.12",
Expand Down Expand Up @@ -434,10 +430,10 @@ http_archive(
)

# Tensorflow repo should always go after the other external dependencies.
# 2021-06-07
_TENSORFLOW_GIT_COMMIT = "700533808e6016dc458bb2eeecfca4babfc482ec"
# 2021-07-29
_TENSORFLOW_GIT_COMMIT = "52a2905cbc21034766c08041933053178c5d10e3"

_TENSORFLOW_SHA256 = "b6edd7f4039bfc19f3e77594ecff558ba620091d0dc48181484b3d9085026126"
_TENSORFLOW_SHA256 = "06d4691bcdb700f3275fa0971a1585221c2b9f3dffe867963be565a6643d7f56"

http_archive(
name = "org_tensorflow",
Expand All @@ -447,6 +443,8 @@ http_archive(
patches = [
"@com_google_mediapipe//third_party:org_tensorflow_compatibility_fixes.diff",
"@com_google_mediapipe//third_party:org_tensorflow_objc_cxx17.diff",
# Diff is generated with a script, don't update it manually.
"@com_google_mediapipe//third_party:org_tensorflow_custom_ops.diff",
"@//third_party:tensorflow_python_path.diff",
],
sha256 = _TENSORFLOW_SHA256,
Expand All @@ -463,3 +461,21 @@ tf_workspace3()
load("@org_tensorflow//tensorflow:workspace2.bzl", "tf_workspace2")

tf_workspace2()

# Edge TPU
http_archive(
name = "libedgetpu",
sha256 = "14d5527a943a25bc648c28a9961f954f70ba4d79c0a9ca5ae226e1831d72fe80",
strip_prefix = "libedgetpu-3164995622300286ef2bb14d7fdc2792dae045b7",
urls = [
"https://github.com/google-coral/libedgetpu/archive/3164995622300286ef2bb14d7fdc2792dae045b7.tar.gz",
],
)

load("@libedgetpu//:workspace.bzl", "libedgetpu_dependencies")

libedgetpu_dependencies()

load("@coral_crosstool//:configure.bzl", "cc_crosstool")

cc_crosstool(name = "crosstool")
7 changes: 0 additions & 7 deletions mediapipe_api/gpu/gl_calculator_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,6 @@ MpReturnCode mp_GlTexture__(mediapipe::GlTexture** gl_texture_out) {
CATCH_EXCEPTION
}

MpReturnCode mp_GlTexture__ui_i_i(GLuint name, int width, int height, mediapipe::GlTexture** gl_texture_out) {
TRY
*gl_texture_out = new mediapipe::GlTexture{name, width, height};
RETURN_CODE(MpReturnCode::Success);
CATCH_EXCEPTION
}

void mp_GlTexture__delete(mediapipe::GlTexture* gl_texture) { delete gl_texture; }

int mp_GlTexture__width(mediapipe::GlTexture* gl_texture) { return gl_texture->width(); }
Expand Down
1 change: 0 additions & 1 deletion mediapipe_api/gpu/gl_calculator_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ MP_CAPI(bool) mp_GlCalculatorHelper__Initialized(mediapipe::GlCalculatorHelper*

/** GlTexture API */
MP_CAPI(MpReturnCode) mp_GlTexture__(mediapipe::GlTexture** gl_texture_out);
MP_CAPI(MpReturnCode) mp_GlTexture__ui_i_i(GLuint name, int width, int height, mediapipe::GlTexture** gl_texture_out);
MP_CAPI(void) mp_GlTexture__delete(mediapipe::GlTexture* gl_texture);
MP_CAPI(int) mp_GlTexture__width(mediapipe::GlTexture* gl_texture);
MP_CAPI(int) mp_GlTexture__height(mediapipe::GlTexture* gl_texture);
Expand Down
Loading

0 comments on commit c603366

Please sign in to comment.