From be956d4ae2e3952b880eab90852da211706303da Mon Sep 17 00:00:00 2001 From: Koki Ibukuro Date: Fri, 9 Aug 2024 11:56:54 +0900 Subject: [PATCH 1/5] Upgrade TextureSource version --- Packages/manifest.json | 2 +- Packages/packages-lock.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Packages/manifest.json b/Packages/manifest.json index 9d2b32da6..e92f1b899 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -10,7 +10,7 @@ ], "dependencies": { "com.cysharp.unitask": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask#2.5.3", - "com.github.asus4.texture-source": "0.3.0", + "com.github.asus4.texture-source": "0.3.2", "com.unity.2d.sprite": "1.0.0", "com.unity.collections": "2.1.4", "com.unity.ext.nunit": "1.0.6", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 42d1e8369..e129a1dff 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -17,7 +17,7 @@ } }, "com.github.asus4.texture-source": { - "version": "0.3.0", + "version": "0.3.2", "depth": 0, "source": "registry", "dependencies": { From 88c988058e122848cf79324aaca78ac09f2da253 Mon Sep 17 00:00:00 2001 From: Koki Ibukuro Date: Fri, 9 Aug 2024 12:18:49 +0900 Subject: [PATCH 2/5] Upgrade UniTask to the latest version --- Packages/manifest.json | 2 +- Packages/packages-lock.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Packages/manifest.json b/Packages/manifest.json index e92f1b899..bf59b7f68 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -9,7 +9,7 @@ } ], "dependencies": { - "com.cysharp.unitask": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask#2.5.3", + "com.cysharp.unitask": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask#2.5.5", "com.github.asus4.texture-source": "0.3.2", "com.unity.2d.sprite": "1.0.0", "com.unity.collections": "2.1.4", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index e129a1dff..0962234c9 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -1,11 +1,11 @@ { "dependencies": { "com.cysharp.unitask": { - "version": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask#2.5.3", + "version": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask#2.5.5", "depth": 0, "source": "git", "dependencies": {}, - "hash": "64792b672d35e43b3412fc74861f8bdbf41e3a6f" + "hash": "cdf88c6a6ac8c9b7e6e5d3c0a360a4af29641c24" }, "com.github.asus4.mediapipe": { "version": "file:com.github.asus4.mediapipe", From 6f972167ddf3b9a19e6c0fe3912f5c879088cdc3 Mon Sep 17 00:00:00 2001 From: Koki Ibukuro Date: Fri, 9 Aug 2024 15:55:22 +0900 Subject: [PATCH 3/5] Revert debug option --- .../com.github.asus4.tflite.common/Runtime/BaseVisionTask.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/com.github.asus4.tflite.common/Runtime/BaseVisionTask.cs b/Packages/com.github.asus4.tflite.common/Runtime/BaseVisionTask.cs index 948375ed6..06efe095c 100644 --- a/Packages/com.github.asus4.tflite.common/Runtime/BaseVisionTask.cs +++ b/Packages/com.github.asus4.tflite.common/Runtime/BaseVisionTask.cs @@ -119,7 +119,7 @@ protected virtual void PreProcess(Texture texture) protected abstract void PostProcess(); // Only available when UniTask is installed -#if TFLITE_UNITASK_ENABLED || true +#if TFLITE_UNITASK_ENABLED public virtual async UniTask RunAsync(Texture texture, CancellationToken cancellationToken) { if (isDisposed) From 8ce7d4445012ec2c2a8e72b1005e231567e8f91d Mon Sep 17 00:00:00 2001 From: Koki Ibukuro Date: Fri, 9 Aug 2024 15:57:03 +0900 Subject: [PATCH 4/5] Add option whether wait or not main thread --- .../Runtime/BaseVisionTask.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Packages/com.github.asus4.tflite.common/Runtime/BaseVisionTask.cs b/Packages/com.github.asus4.tflite.common/Runtime/BaseVisionTask.cs index 06efe095c..b38416a00 100644 --- a/Packages/com.github.asus4.tflite.common/Runtime/BaseVisionTask.cs +++ b/Packages/com.github.asus4.tflite.common/Runtime/BaseVisionTask.cs @@ -121,6 +121,14 @@ protected virtual void PreProcess(Texture texture) // Only available when UniTask is installed #if TFLITE_UNITASK_ENABLED public virtual async UniTask RunAsync(Texture texture, CancellationToken cancellationToken) + { + await RunAsync(texture, cancellationToken, true); + } + + public virtual async UniTask RunAsync( + Texture texture, + CancellationToken cancellationToken, + bool waitForMainThread) { if (isDisposed) { @@ -151,8 +159,11 @@ public virtual async UniTask RunAsync(Texture texture, CancellationToken cancell semaphore.Release(); } - // Back to main thread - await UniTask.SwitchToMainThread(); + if (waitForMainThread) + { + // Back to main thread + await UniTask.SwitchToMainThread(); + } } protected virtual async UniTask PreProcessAsync(Texture texture, CancellationToken cancellationToken) From 96e892e8db2dfaa8612ae6da33e60c6ae98b56b5 Mon Sep 17 00:00:00 2001 From: Koki Ibukuro Date: Fri, 9 Aug 2024 15:57:42 +0900 Subject: [PATCH 5/5] Bump version --- Packages/com.github.asus4.mediapipe/package.json | 6 +++--- Packages/com.github.asus4.tflite.common/package.json | 4 ++-- Packages/com.github.asus4.tflite/package.json | 2 +- Packages/packages-lock.json | 6 +++--- README.md | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Packages/com.github.asus4.mediapipe/package.json b/Packages/com.github.asus4.mediapipe/package.json index 57f8691f3..ecb63c040 100644 --- a/Packages/com.github.asus4.mediapipe/package.json +++ b/Packages/com.github.asus4.mediapipe/package.json @@ -10,11 +10,11 @@ "license": "Apache License 2.0", "unity": "2022.3", "unityRelease": "0f1", - "version": "2.16.1-p1", + "version": "2.16.1-p2", "hideInEditor": false, "dependencies": { - "com.github.asus4.tflite": "2.16.1-p1", - "com.github.asus4.tflite.common": "2.16.1-p1" + "com.github.asus4.tflite": "2.16.1-p2", + "com.github.asus4.tflite.common": "2.16.1-p2" }, "documentationUrl": "https://github.com/asus4/tf-lite-unity-sample", "changelogUrl": "https://github.com/asus4/tf-lite-unity-sample/releases", diff --git a/Packages/com.github.asus4.tflite.common/package.json b/Packages/com.github.asus4.tflite.common/package.json index 2e7e87b08..270fe29d2 100644 --- a/Packages/com.github.asus4.tflite.common/package.json +++ b/Packages/com.github.asus4.tflite.common/package.json @@ -9,11 +9,11 @@ "license": "Apache License 2.0", "unity": "2022.3", "unityRelease": "0f1", - "version": "2.16.1-p1", + "version": "2.16.1-p2", "hideInEditor": false, "dependencies": { "com.unity.burst": "1.8.12", - "com.github.asus4.tflite": "2.16.1-p1" + "com.github.asus4.tflite": "2.16.1-p2" }, "repository": { "type": "git", diff --git a/Packages/com.github.asus4.tflite/package.json b/Packages/com.github.asus4.tflite/package.json index a9a5dfd19..96344dcb6 100644 --- a/Packages/com.github.asus4.tflite/package.json +++ b/Packages/com.github.asus4.tflite/package.json @@ -9,7 +9,7 @@ "license": "Apache License 2.0", "unity": "2022.3", "unityRelease": "0f1", - "version": "2.16.1-p1", + "version": "2.16.1-p2", "hideInEditor": false, "repository": { "type": "git", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 0962234c9..3e7b7b513 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -12,8 +12,8 @@ "depth": 0, "source": "embedded", "dependencies": { - "com.github.asus4.tflite": "2.16.1-p1", - "com.github.asus4.tflite.common": "2.16.1-p1" + "com.github.asus4.tflite": "2.16.1-p2", + "com.github.asus4.tflite.common": "2.16.1-p2" } }, "com.github.asus4.texture-source": { @@ -37,7 +37,7 @@ "source": "embedded", "dependencies": { "com.unity.burst": "1.8.12", - "com.github.asus4.tflite": "2.16.1-p1" + "com.github.asus4.tflite": "2.16.1-p2" } }, "com.unity.2d.sprite": { diff --git a/README.md b/README.md index e23ac5765..a52316360 100644 --- a/README.md +++ b/README.md @@ -68,11 +68,11 @@ Included prebuilt libraries: ], "dependencies": { // Core TensorFlow Lite libraries - "com.github.asus4.tflite": "2.16.1-p1", + "com.github.asus4.tflite": "2.16.1-p2", // Utilities for TFLite - "com.github.asus4.tflite.common": "2.16.1-p1", + "com.github.asus4.tflite.common": "2.16.1-p2", // Utilities for MediaPipe - "com.github.asus4.mediapipe": "2.16.1-p1", + "com.github.asus4.mediapipe": "2.16.1-p2", ...// other dependencies } }