digital-standard / ThreeDPoseUnityBarracuda

Unity sample of 3D pose estimation using Barracuda
1.43k stars 275 forks source link

How we can get this efficiently running with lower computational power ? #22

Open rushu570 opened 3 years ago

rushu570 commented 3 years ago

How we can increase the fps and reduce the lag, on devices with less computational power(<=1050)?

alezuky commented 3 years ago

The BarracudaRunner functionalities are the ones that require computational power. They are called every Update cycle at function "UpdateVNectModel()" from that script. I have been trying to call that function not every Update cycle, but once after some Update cycles. This way, we could decrease the lag at the cost of the model being updated with less frequency. However, I get this error when I try to reduce the frequency of the calls:

" KeyNotFoundException: The given key was not present in the dictionary. System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <437ba245d8404784b9fbab9b439ac908>:0) Unity.Barracuda.GenericVars.PeekOutput (System.String name) (at Library/PackageCache/com.unity.barracuda@1.0.0/Barracuda/Runtime/Core/Backends/GenericWorker.cs:1004) Unity.Barracuda.GenericVarsWithReuse.PeekOutput (System.String name) (at Library/PackageCache/com.unity.barracuda@1.0.0/Barracuda/Runtime/Core/Backends/GenericWorker.cs:1106) Unity.Barracuda.GenericVars.GatherInputs (Unity.Barracuda.Layer forLayer) (at Library/PackageCache/com.unity.barracuda@1.0.0/Barracuda/Runtime/Core/Backends/GenericWorker.cs:951) Unity.Barracuda.GenericWorker+d__29.MoveNext () (at Library/PackageCache/com.unity.barracuda@1.0.0/Barracuda/Runtime/Core/Backends/GenericWorker.cs:176) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <480508088aee40cab70818ff164a29d5>:0) "

Would anyone have any idea on how to do it?

alezuky commented 3 years ago

Hi, does anyone have any update on this?

alezuky commented 3 years ago

Ok, guess I found a possible solution. If anyone is still interested, just let me know here and I can explain it.

Drod917 commented 3 years ago

@alezuky Hello, I'm interested in your solution; I'm trying to get a proof of concept working using this on a mobile device so any tips are welcome