Kariaro / VRigUnity

VRM hand tracking using mediapipe
https://discord.com/invite/Enaup9TJPd
MIT License
172 stars 32 forks source link

[Bug]: High CPU usage #66

Open jlarisch opened 1 year ago

jlarisch commented 1 year ago

OS

Windows

App Version

v0.4.1

Description

Windows 11, CPU i7 7700k , webcam Logitech c925e The software using the camera and sending VMC is using 65% of my CPU. Even when webcam and VMC sender is off , the CPU usage this is 18 %.

It does not make sense to me. I have done the handtracking in mediapepi in python and my usage was lower than 10%.

Maybe an option to change de model complexity, mine was 0 and working on the hands.

Captura de tela 2023-03-01 020615

extras issues:

Logs

No response

Kariaro commented 1 year ago

I’m currently using model complexity 1 for the tool. This is a feature I really want to add! I can add this for the next version.

This tool performs better with lower camera resolutions (You could even try 140p). I wrote a small optimization guide: https://github.com/Kariaro/VRigUnity/wiki/Optimizing

The webcam fps will be limited by how fast the AI is. Higher resolutions makes the AI really slow.

Bone configuration will be fixed next version. The bone settings was experimental for a while.

One question:

jlarisch commented 1 year ago

Hello there, thank you for the quick response ! And for doing this project.

Just follow the guide, no sucess, this using 50% when tracking and 12% when doing nothing.

Try my code with model_complexity in 1 and still much lower usage.

I used the medipipe CPU. Below there is a zip with my code. Take a look at the section "Ignoring empty camera frame", it might fix the high usage when is not tracking.

HandTracking.zip

this code is almost the example they use on ther website.