Tobias-Fischer / rt_gene

RT-GENE: Real-Time Eye Gaze and Blink Estimation in Natural Environments
http://www.imperial.ac.uk/personal-robotics
Other
365 stars 68 forks source link

README fix + performance enhancement for face detector #33

Closed ahmed-alhindawi closed 4 years ago

ahmed-alhindawi commented 4 years ago
Tobias-Fischer commented 4 years ago

Thanks a lot @ngageorange!!!

ahmed-alhindawi commented 4 years ago

Just as a thought - would those environment variables have been better off being in the roslaunch as an <env> tag with arguments from the command line? It feels that having psutil as a dependency purely to see how many CPU cores are available is probably unnecessary, especially as the <env> tag exists.

What do you think?

Tobias-Fischer commented 4 years ago

Hmmm. I did not even realise the PR introduced another external dependency. How about using multiprocessing.cpu_count() instead? That's in the standard library.

ahmed-alhindawi commented 4 years ago

That provides hyperthreaded CPU count which PyTorch seem to be particularly keen on avoiding; on my system multiprocessing.cpu_count() returns 16 when it should be 8. Hence the external dependency.

I think a grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}' set to an environment variable during roslaunch would suffice for OMP_THREAD_NUM. The others can be made static...

What do you think?

Tobias-Fischer commented 4 years ago

That sounds good to me. Feel free to push directly to master. Thanks Ahmed!