Low frame rate using worker.Schedule()

Hi, I am using the Unity Inference Engine to run a body tracking onnx model, and I want to run it on and IOS device like iPhone or iPad.

Model:

The game runs well in Unity editor, and at first also on the IOS devices. But after some irrelavent updates on the app, the IOS build perform with low frame rate. The low frame rate problem remains even after I deleted my afterward updates.

I found that the line that gives the low frame rate is
worker.Schedule(inputs[0], inputs[1], inputs[2]);
the 3 tensor inside having the shape (1, 3, 448, 448)
and the code with run every frame in update

its weird that the app used to run properly with the exact same code in every frame, and now do not.
Can I do anything to fix that? Thanks

Hiya!
Thanks for sharing! One thing the you could try is scheduling inference over multiple frames to reduce performance bottlenecks. We’ve seen good results using ScheduleIterable along with asynchronous execution.

For example, running a hand gesture model (BlazeHands) on a low-spec Galaxy Tab A9+ was only getting 20fps. After switching to ScheduleIterable and async methods, it was able to hit 60fps.

Also worth noting: the model in that GitHub repo is about 5 years old and doesn’t seem updated for Inference Engine 2.2. Compatibility or performance changes since then could also be a factor here.

Thank you so much! This did solve the problem!