geopavlakos / hamer

HaMeR: Reconstructing Hands in 3D with Transformers
https://geopavlakos.github.io/hamer/
MIT License
326 stars 28 forks source link

Running on small memory GPU? #13

Closed tianhaowuhz closed 6 months ago

tianhaowuhz commented 7 months ago

Hi, I am trying to setup this algorithm in a 4060 GPU computer. However, it only has 8GB memory, which can not run this algorithm, I am wondering is there any arguments or something I can change to use less GPU memory, currently the batch size is only set to 1. Thank you!

tianhaowuhz commented 7 months ago

Also, although the hamer model inference speed is fast, the other part is quite slow, which still limit for real time inference, does author might have any suggestion for improve that? Thank you!

geopavlakos commented 6 months ago

Regarding the required memory, we updated the option for body detection in the demo (body_detector argument). Using the option regnety should run with less than 7GB of GPU memory and decrease runtime too. You might observe some small drop in accuracy when it comes to the hand detection aspect.

Regarding runtime in general, the demo can be slow, because it includes the body/hand detection, the rendering, and it also uses the tools with the highest accuracy for detection. You might want to simplify these aspects depending on the application (e.g., if you know the hand location, you can use that directly, or if you have a video, you might want to rely on tracking the hand instead of redetecting it in every frame).

tianhaowuhz commented 6 months ago

Thank you, I will try your suggestion.