SeedV / SeedUnityVRKit

A toolkit using Mediapipe to run motion tracking in Unity. Support desktop, Android and iOS.
Apache License 2.0
19 stars 3 forks source link

Investigate why OnXXXLandmarksOutput is called with null NormalizedLandmarkList #50

Closed henryouly closed 2 years ago

henryouly commented 2 years ago

I made a change in https://github.com/SeedV/SeedUnityVRKit/pull/46/commits/db2d7d8dffa177666b3c7cb6b1d06857621c9203 that fixed the slow down on Windows.

But this commit also hides the root cause. In theory, if the image sent to mediapipe contains a valid posture, the result should not be null.

My current guess is that it hits a queue size limit in mediapipe. It should first queue up some input frames until it's queue is full, then it would drop any new frames after, until there are spaces in the queue again.

There's a frame pool that can be used to control concurrency. Currently the setting is 10. There may be room to optimize to set it to queue size + 1.

Screen Shot 2022-06-21 at 5 41 44 PM

henryouly commented 2 years ago

@superkudo can you help with this one? I think it's a good learning task to mediapipe processing mechanism and how input frames are handled internally.

superkudo commented 2 years ago

Get it,I will track and fix this one

superkudo commented 2 years ago

I debug and compare the MediaPipe and SeedVRKit XXXLandMarksOutput called , find the MediaPipe don’t have call with null with frame pool 10, I will try to find the difference between MediaPiepPlugin and SeedVRKit,I think source input effect the called with null

superkudo commented 2 years ago
image

I find the reason , It was because we set the Timeout Microsec to 0, the mideapipe is not track complete in timeout 0ms,so It callback null, In the demo it suggest set to 100000, I set it and callback null problem is solved