asus4 / tf-lite-unity-sample

TensorFlow Lite Samples on Unity
834 stars 249 forks source link

VideoClassification lag issue #289

Closed Swapnil-gautam closed 1 year ago

Swapnil-gautam commented 1 year ago

Hi, thank you very much for this project. I am working with the VideoClassification sample scene it is working great I trained a custom mobilent model and that is also working fine. The only issue I am facing is that the inference time taken by the classifier in VideoClassification script "runner.Invoke();" in Invoke function takes around 0.6 seconds on most of the devices because of which the camera feed looks laggy. Can the inference be made in a different thread or run in the background so that it does not hinder the webcam feed? I tried async but it did not worked for me. I also tried mediapipe models and they work with good FPS what can I do to make the classifier model run with the same FPS.

Thanks a lot.