amkorousagi commited on
Commit
7c1de39
·
verified ·
1 Parent(s): 3cd4d4c

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.

Files changed (1) hide show
  1. 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
  }