From bf1449dc6fcb820465abcfdb6e4f045c87581b01 Mon Sep 17 00:00:00 2001 From: Speykious Date: Tue, 22 Feb 2022 10:22:18 +0100 Subject: [PATCH 01/15] Update bazel version --- .bazelversion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelversion b/.bazelversion index af8c8ec..0062ac9 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -4.2.2 +5.0.0 From f2b6ade5827a7a2a5789fd550f7d1f85f83d54cb Mon Sep 17 00:00:00 2001 From: Speykious Date: Tue, 22 Feb 2022 10:22:36 +0100 Subject: [PATCH 02/15] Use debug symbols on CI --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 260d227..ce0dac2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -133,11 +133,11 @@ jobs: - name: Build Native Library (*nix, CPU) if: ${{ matrix.os.name != 'Windows' && matrix.os.name != 'Linux_GPU' }} - run: python build.py build --no-install --no-protobuf --desktop cpu --opencv cmake -vv + run: python build.py build --no-install --no-protobuf -c dbg --desktop cpu --opencv cmake -vv - name: Build Native Library (Linux, GPU) if: ${{ matrix.os.name == 'Linux_GPU' }} - run: python build.py build --no-install --no-protobuf --desktop gpu --opencv cmake -vv + run: python build.py build --no-install --no-protobuf -c dbg --desktop gpu --opencv cmake -vv - name: Build Native Library (Windows, CPU) if: ${{ matrix.os.name == 'Windows' }} @@ -145,7 +145,7 @@ jobs: echo "Setting PYTHON_BIN_PATH to python in PATH" $env:PYTHON_BIN_PATH=(Get-Command python).Path echo $env:PYTHON_BIN_PATH - python build.py build --no-install --no-protobuf --desktop cpu --opencv cmake -vv + python build.py build --no-install --no-protobuf -c dbg --desktop cpu --opencv cmake -vv - name: Upload Build Artifacts (${{ matrix.os.name }}) uses: actions/upload-artifact@v2 From cd5aa1c9f237f97d2a8b84e5496c886cbf89748e Mon Sep 17 00:00:00 2001 From: Speykious Date: Tue, 22 Feb 2022 10:22:44 +0100 Subject: [PATCH 03/15] Deploy: Gotta go fast --- .github/workflows/deploy-all.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-all.yml b/.github/workflows/deploy-all.yml index 52402fa..1ed55fd 100644 --- a/.github/workflows/deploy-all.yml +++ b/.github/workflows/deploy-all.yml @@ -126,11 +126,11 @@ jobs: - name: Build Native Library (*nix, CPU) if: ${{ matrix.os.name != 'Windows' && matrix.os.name != 'Linux_GPU' }} - run: python build.py build --no-install --no-protobuf --desktop cpu --opencv cmake -vv + run: python build.py build --no-install --no-protobuf -c fastbuild --desktop cpu --opencv cmake -vv - name: Build Native Library (Linux, GPU) if: ${{ matrix.os.name == 'Linux_GPU' }} - run: python build.py build --no-install --no-protobuf --desktop gpu --opencv cmake -vv + run: python build.py build --no-install --no-protobuf -c fastbuild --desktop gpu --opencv cmake -vv - name: Build Native Library (Windows, CPU) if: ${{ matrix.os.name == 'Windows' }} @@ -138,7 +138,7 @@ jobs: echo "Setting PYTHON_BIN_PATH to python in PATH" $env:PYTHON_BIN_PATH=(Get-Command python).Path echo $env:PYTHON_BIN_PATH - python build.py build --no-install --no-protobuf --desktop cpu --opencv cmake -vv + python build.py build --no-install --no-protobuf -c fastbuild --desktop cpu --opencv cmake -vv - name: Upload Build Artifacts (${{ matrix.os.name }}) uses: actions/upload-artifact@v2 From 82166672c6742a65d12262d79460501cb9d81e58 Mon Sep 17 00:00:00 2001 From: Speykious Date: Tue, 22 Feb 2022 10:29:02 +0100 Subject: [PATCH 04/15] Disable MacOS builds (we poor) --- .github/workflows/ci.yml | 18 +++++++++--------- .github/workflows/deploy-all.yml | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce0dac2..3174d8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,9 +89,9 @@ jobs: - name: Linux_GPU runner: ubuntu-latest cache-path: ~/.cache/bazel - - name: MacOS - runner: macos-latest - cache-path: ~/_bzl + # - name: MacOS + # runner: macos-latest + # cache-path: ~/_bzl steps: - name: Cache Bazel directory uses: actions/cache@v2 @@ -198,12 +198,12 @@ jobs: name: Build.Linux_GPU path: build/ - - name: Download MacOS build artifacts - if: ${{ matrix.comp == 'CPU' }} - uses: actions/download-artifact@v2 - with: - name: Build.MacOS - path: build/ + # - name: Download MacOS build artifacts + # if: ${{ matrix.comp == 'CPU' }} + # uses: actions/download-artifact@v2 + # with: + # name: Build.MacOS + # path: build/ - name: Install artifacts run: python build.py build --no-protobuf -vv diff --git a/.github/workflows/deploy-all.yml b/.github/workflows/deploy-all.yml index 1ed55fd..777deaf 100644 --- a/.github/workflows/deploy-all.yml +++ b/.github/workflows/deploy-all.yml @@ -82,9 +82,9 @@ jobs: - name: Linux_GPU runner: ubuntu-latest cache-path: ~/.cache/bazel - - name: MacOS - runner: macos-latest - cache-path: ~/_bzl + # - name: MacOS + # runner: macos-latest + # cache-path: ~/_bzl steps: - name: Cache Bazel directory uses: actions/cache@v2 @@ -191,12 +191,12 @@ jobs: name: Build.Linux_GPU path: build/ - - name: Download MacOS build artifacts - if: ${{ matrix.comp == 'CPU' }} - uses: actions/download-artifact@v2 - with: - name: Build.MacOS - path: build/ + # - name: Download MacOS build artifacts + # if: ${{ matrix.comp == 'CPU' }} + # uses: actions/download-artifact@v2 + # with: + # name: Build.MacOS + # path: build/ - name: Install artifacts run: python build.py build --no-protobuf -vv From 6df5260dd902ac11193c4ffff5ebe3fd20d2b2dc Mon Sep 17 00:00:00 2001 From: Speykious Date: Tue, 22 Feb 2022 10:29:21 +0100 Subject: [PATCH 05/15] Would this work? --- Mediapipe.Net.Runtime.CPU/Mediapipe.Net.Runtime.CPU.csproj | 2 +- Mediapipe.Net.Runtime.GPU/Mediapipe.Net.Runtime.GPU.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mediapipe.Net.Runtime.CPU/Mediapipe.Net.Runtime.CPU.csproj b/Mediapipe.Net.Runtime.CPU/Mediapipe.Net.Runtime.CPU.csproj index c0621e9..14c20bd 100644 --- a/Mediapipe.Net.Runtime.CPU/Mediapipe.Net.Runtime.CPU.csproj +++ b/Mediapipe.Net.Runtime.CPU/Mediapipe.Net.Runtime.CPU.csproj @@ -10,7 +10,7 @@ true Mediapipe.Net.Runtime.CPU - 0.8.9 + 0.8.9-1 homuler;Vignette Google;Mediapipe;Tracking;Media Analysis Mediapipe.Net.Runtime.CPU diff --git a/Mediapipe.Net.Runtime.GPU/Mediapipe.Net.Runtime.GPU.csproj b/Mediapipe.Net.Runtime.GPU/Mediapipe.Net.Runtime.GPU.csproj index 80abf5f..4e1f7f6 100644 --- a/Mediapipe.Net.Runtime.GPU/Mediapipe.Net.Runtime.GPU.csproj +++ b/Mediapipe.Net.Runtime.GPU/Mediapipe.Net.Runtime.GPU.csproj @@ -10,7 +10,7 @@ true Mediapipe.Net.Runtime.GPU - 0.8.9 + 0.8.9-1 homuler;Vignette Google;Mediapipe;Tracking;Media Analysis Mediapipe.Net.Runtime.GPU From 34aa71c17b541722eec608e269a099bb3994268f Mon Sep 17 00:00:00 2001 From: Speykious Date: Tue, 22 Feb 2022 10:41:34 +0100 Subject: [PATCH 06/15] Only target .NET 6 There's a problem that occurs when trying to target multiple frameworks. :/ --- Mediapipe.Net.Runtime.CPU/Mediapipe.Net.Runtime.CPU.csproj | 2 +- Mediapipe.Net.Runtime.GPU/Mediapipe.Net.Runtime.GPU.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mediapipe.Net.Runtime.CPU/Mediapipe.Net.Runtime.CPU.csproj b/Mediapipe.Net.Runtime.CPU/Mediapipe.Net.Runtime.CPU.csproj index 14c20bd..db6a5d5 100644 --- a/Mediapipe.Net.Runtime.CPU/Mediapipe.Net.Runtime.CPU.csproj +++ b/Mediapipe.Net.Runtime.CPU/Mediapipe.Net.Runtime.CPU.csproj @@ -1,7 +1,7 @@ - net6.0;netstandard2.1 + net6.0 Library Mediapipe.Net.Runtime.CPU Mediapipe.Net.Runtime.CPU diff --git a/Mediapipe.Net.Runtime.GPU/Mediapipe.Net.Runtime.GPU.csproj b/Mediapipe.Net.Runtime.GPU/Mediapipe.Net.Runtime.GPU.csproj index 4e1f7f6..2eb2f54 100644 --- a/Mediapipe.Net.Runtime.GPU/Mediapipe.Net.Runtime.GPU.csproj +++ b/Mediapipe.Net.Runtime.GPU/Mediapipe.Net.Runtime.GPU.csproj @@ -1,7 +1,7 @@ - net6.0;netstandard2.1 + net6.0 Library Mediapipe.Net.Runtime.GPU Mediapipe.Net.Runtime.GPU From 737f5bef2cba9b70e5fd0c2d7f4caf10ef5bd743 Mon Sep 17 00:00:00 2001 From: Speykious Date: Wed, 16 Mar 2022 18:35:34 +0100 Subject: [PATCH 07/15] Comment out Android NDK and SDK from WORKSPACE --- WORKSPACE | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 07c27ac..1dd05aa 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -325,17 +325,17 @@ http_archive( ) # You may run setup_android.sh to install Android SDK and NDK. -android_ndk_repository( - name = "androidndk", - # If you need to support older versions of Android, please specify the API Level. - # Otherwise, some symbols in libmediapipe_jni.so cannot be resolved and `DllNotFoundException` will be thrown. +# android_ndk_repository( +# name = "androidndk", +# # If you need to support older versions of Android, please specify the API Level. +# # Otherwise, some symbols in libmediapipe_jni.so cannot be resolved and `DllNotFoundException` will be thrown. - # api_level = 21, -) +# # api_level = 21, +# ) -android_sdk_repository( - name = "androidsdk", -) +# android_sdk_repository( +# name = "androidsdk", +# ) # iOS basic build deps. From c25b2ca9d3baf4137e5856a3971a400c1283f5e2 Mon Sep 17 00:00:00 2001 From: Speykious Date: Wed, 16 Mar 2022 18:54:59 +0100 Subject: [PATCH 08/15] Setup compile commands for VSCode --- .gitignore | 1 + .vscode/settings.json | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index ad4a37f..e5dfef3 100644 --- a/.gitignore +++ b/.gitignore @@ -457,6 +457,7 @@ $RECYCLE.BIN/ # Bazel bazel-* +compile_commands.json # Build and binary folders build/ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..698c975 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,12 @@ +{ + "bsv.bazel.buildFlags": ["-c", "opt", "--define", "MEDIAPIPE_DISABLE_GPU=1"], + "bsv.cc.compdb.targets": [ + "//mediapipe_api/framework/...", + "//mediapipe_api/graphs/...", + "//mediapipe_api/modules/...", + "//mediapipe_api/util/...", + "//mediapipe_api:calculators", + "//mediapipe_api:common", + "//mediapipe_api:mediapipe_c", + ] +} \ No newline at end of file From 9621ceaa858018f4e4996d8030d53a83c68f9ef2 Mon Sep 17 00:00:00 2001 From: Speykious Date: Wed, 16 Mar 2022 18:56:14 +0100 Subject: [PATCH 09/15] Update apt packages on CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3174d8b..c952c37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,7 +115,7 @@ jobs: - name: Setup EGL (Linux, GPU) if: ${{ matrix.os.name == 'Linux_GPU' }} - run: sudo apt install libglfw3-dev libgles2-mesa-dev + run: sudo apt update && sudo apt install libglfw3-dev libgles2-mesa-dev - name: Setup .NET 6 uses: actions/setup-dotnet@v1 From 19f61403f62506563cf6a886b6474d930dd540fa Mon Sep 17 00:00:00 2001 From: Speykious Date: Thu, 17 Mar 2022 10:26:43 +0100 Subject: [PATCH 10/15] Fix version number --- Mediapipe.Net.Runtime.CPU/Mediapipe.Net.Runtime.CPU.csproj | 2 +- Mediapipe.Net.Runtime.GPU/Mediapipe.Net.Runtime.GPU.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mediapipe.Net.Runtime.CPU/Mediapipe.Net.Runtime.CPU.csproj b/Mediapipe.Net.Runtime.CPU/Mediapipe.Net.Runtime.CPU.csproj index db6a5d5..f796589 100644 --- a/Mediapipe.Net.Runtime.CPU/Mediapipe.Net.Runtime.CPU.csproj +++ b/Mediapipe.Net.Runtime.CPU/Mediapipe.Net.Runtime.CPU.csproj @@ -10,7 +10,7 @@ true Mediapipe.Net.Runtime.CPU - 0.8.9-1 + 0.8.9.1 homuler;Vignette Google;Mediapipe;Tracking;Media Analysis Mediapipe.Net.Runtime.CPU diff --git a/Mediapipe.Net.Runtime.GPU/Mediapipe.Net.Runtime.GPU.csproj b/Mediapipe.Net.Runtime.GPU/Mediapipe.Net.Runtime.GPU.csproj index 2eb2f54..3c1c6cd 100644 --- a/Mediapipe.Net.Runtime.GPU/Mediapipe.Net.Runtime.GPU.csproj +++ b/Mediapipe.Net.Runtime.GPU/Mediapipe.Net.Runtime.GPU.csproj @@ -10,7 +10,7 @@ true Mediapipe.Net.Runtime.GPU - 0.8.9-1 + 0.8.9.1 homuler;Vignette Google;Mediapipe;Tracking;Media Analysis Mediapipe.Net.Runtime.GPU From c7586fd15c730263673bc57487e222c3c7cb185e Mon Sep 17 00:00:00 2001 From: Speykious Date: Thu, 17 Mar 2022 12:34:38 +0100 Subject: [PATCH 11/15] Remove emscripten dependency --- third_party/mediapipe_extension.diff | 8 -------- 1 file changed, 8 deletions(-) diff --git a/third_party/mediapipe_extension.diff b/third_party/mediapipe_extension.diff index 75653eb..b5937c0 100644 --- a/third_party/mediapipe_extension.diff +++ b/third_party/mediapipe_extension.diff @@ -35,14 +35,6 @@ diff --git a/mediapipe/calculators/tensor/BUILD b/mediapipe/calculators/tensor/B index 72c2f51..d43c261 100644 --- a/mediapipe/calculators/tensor/BUILD +++ b/mediapipe/calculators/tensor/BUILD -@@ -35,6 +35,7 @@ selects.config_setting_group( - name = "compute_shader_unavailable", - match_any = [ - "//mediapipe/gpu:disable_gpu", -+ "//mediapipe:emscripten", - ], - ) - @@ -572,6 +573,11 @@ cc_library( "//mediapipe/gpu:MPPMetalHelper", "//mediapipe/gpu:gpu_buffer", From f1c519f1a8eda17812443c384e8466458875aa5b Mon Sep 17 00:00:00 2001 From: Speykious Date: Thu, 17 Mar 2022 20:08:58 +0100 Subject: [PATCH 12/15] Setup MSBuild on Windows CI --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c952c37..e769aa7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,6 +117,10 @@ jobs: if: ${{ matrix.os.name == 'Linux_GPU' }} run: sudo apt update && sudo apt install libglfw3-dev libgles2-mesa-dev + - name: Setup MSBuild + if: ${{ matrix.os.name == 'Windows' }} + uses: microsoft/setup-msbuild@v1.1 + - name: Setup .NET 6 uses: actions/setup-dotnet@v1 with: From a9105a1ab5b47227330ecb7e51b18c5d782bb209 Mon Sep 17 00:00:00 2001 From: Speykious Date: Thu, 17 Mar 2022 21:04:10 +0100 Subject: [PATCH 13/15] Add MSBuild setup options --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e769aa7..8608530 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,6 +120,9 @@ jobs: - name: Setup MSBuild if: ${{ matrix.os.name == 'Windows' }} uses: microsoft/setup-msbuild@v1.1 + with: + vs-version: 16 + msbuild-architecture: x64 - name: Setup .NET 6 uses: actions/setup-dotnet@v1 From ccf27b5084400a114d3f1ec91f6a633d08c616ff Mon Sep 17 00:00:00 2001 From: Speykious Date: Thu, 17 Mar 2022 21:47:57 +0100 Subject: [PATCH 14/15] Remove `dbg` flag on Windows :( --- .github/workflows/ci.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8608530..827e962 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,13 +117,6 @@ jobs: if: ${{ matrix.os.name == 'Linux_GPU' }} run: sudo apt update && sudo apt install libglfw3-dev libgles2-mesa-dev - - name: Setup MSBuild - if: ${{ matrix.os.name == 'Windows' }} - uses: microsoft/setup-msbuild@v1.1 - with: - vs-version: 16 - msbuild-architecture: x64 - - name: Setup .NET 6 uses: actions/setup-dotnet@v1 with: @@ -152,7 +145,7 @@ jobs: echo "Setting PYTHON_BIN_PATH to python in PATH" $env:PYTHON_BIN_PATH=(Get-Command python).Path echo $env:PYTHON_BIN_PATH - python build.py build --no-install --no-protobuf -c dbg --desktop cpu --opencv cmake -vv + python build.py build --no-install --no-protobuf --desktop cpu --opencv cmake -vv - name: Upload Build Artifacts (${{ matrix.os.name }}) uses: actions/upload-artifact@v2 From 9e2793fd05182db5033aa10fd82e8fa09211960a Mon Sep 17 00:00:00 2001 From: Speykious Date: Sat, 19 Mar 2022 17:31:30 +0100 Subject: [PATCH 15/15] Use Windows Server 2019 runner --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 827e962..097f0b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,7 +81,7 @@ jobs: matrix: os: - name: Windows - runner: windows-latest + runner: windows-2019 cache-path: C:/_bzl - name: Linux_CPU runner: ubuntu-latest @@ -145,7 +145,7 @@ jobs: echo "Setting PYTHON_BIN_PATH to python in PATH" $env:PYTHON_BIN_PATH=(Get-Command python).Path echo $env:PYTHON_BIN_PATH - python build.py build --no-install --no-protobuf --desktop cpu --opencv cmake -vv + python build.py build --no-install --no-protobuf -c dbg --desktop cpu --opencv cmake -vv - name: Upload Build Artifacts (${{ matrix.os.name }}) uses: actions/upload-artifact@v2