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/Runtime/BaseVisionTask.cs b/Packages/com.github.asus4.tflite.common/Runtime/BaseVisionTask.cs index 948375ed6..b38416a00 100644 --- a/Packages/com.github.asus4.tflite.common/Runtime/BaseVisionTask.cs +++ b/Packages/com.github.asus4.tflite.common/Runtime/BaseVisionTask.cs @@ -119,8 +119,16 @@ 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) + { + 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) 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/manifest.json b/Packages/manifest.json index 9d2b32da6..bf59b7f68 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -9,8 +9,8 @@ } ], "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.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", "com.unity.ext.nunit": "1.0.6", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 42d1e8369..3e7b7b513 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -1,23 +1,23 @@ { "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", "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": { - "version": "0.3.0", + "version": "0.3.2", "depth": 0, "source": "registry", "dependencies": { @@ -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 } }