prevent using canvasTexture as Input
Browse files## Problem
- If InputType is Webcam, always call RunInference in LateUpdate, even if targetTexture is corrupted because blit with canvasTexture.
## Solution
- do not call when didUpdateThisFrame is false in Webcam InputType.
- RunFaceLandmark.cs +2 -0
RunFaceLandmark.cs
CHANGED
@@ -188,6 +188,8 @@ public class RunFaceLandmark : MonoBehaviour
|
|
188 |
{
|
189 |
if (!closing)
|
190 |
{
|
|
|
|
|
191 |
RunInference(targetTexture);
|
192 |
}
|
193 |
}
|
|
|
188 |
{
|
189 |
if (!closing)
|
190 |
{
|
191 |
+
if (inputType == InputType.Webcam && !webcam.didUpdateThisFrame) return;
|
192 |
+
|
193 |
RunInference(targetTexture);
|
194 |
}
|
195 |
}
|