ageitgey / face_recognition

The world's simplest facial recognition api for Python and the command line
MIT License
53.58k stars 13.51k forks source link

GPU guidelines (informational)? #798

Closed pliablepixels closed 5 years ago

pliablepixels commented 5 years ago

Description

Thank you for such a lovely wrapper around Dlib. I recently added face recognition for ZoneMinder (an open source NVR).

Everything works great, but in my situation (and folks who use my code), it looks like we need cnn to reliably detect faces (the article linked above explains why - HOG just doesn't cut it, no matter how much I upsample or add jitters. cnn reliably detects.

However, most of the folks using these systems don't have a GPU and typically run Ubuntu or some Debian distro. When I changed from hog to cnn, detection time changed from less than a second to 20 seconds. Updated: sudo apt-get install libopenblas-dev liblapack-dev libblas-dev and then installing dlib via pip reduced the time from 20 to 7.6 seconds.

I was hoping you could suggest a configuration that I can recommend to my users:

a) What is the most cost effective GPU they can purchase that is compatible with ubuntu/linux and your solution (Dlib library, I suppose) that can reduce this to a max of 1s detection time. Lets assume a typical configuration to be an Intel Xeon @ 3.16GHz with 32GB Ram

b) As of today, its very easy for my users to install your module via pip. If they add a GPU, will they have to recompile dlib from source or is there a python package they can use? (found the answer to this - looks like pip install dlib automatically configures SSE/AVX/CUDA depending on the processor capabilities!)

Thx

soundreactor commented 5 years ago

a) i have a 1050Ti and get at least 33fps at 512px wide images

pliablepixels commented 5 years ago

@soundreactor awesome - do you mean this ? The price is much lower than I expected. Did you also have to install nvidia drivers and reconfigure dlib after that?

soundreactor commented 5 years ago

yes that card. i'm using windows. but yes i had to install cuda 10.1 and the cudnn library. after that the dlib compile script did everything. for ubuntu there are some bash scripts that do all the cuda and cudnn installation for you. one example is the fast.ai script (http://files.fast.ai/setup/paperspace) it installs cuda 9. cuda 9 could be okey on ubuntu. (on windows cuda 10 is required or the build fails)

pliablepixels commented 5 years ago

Thank you @soundreactor - much appreciated