First, thank you for your great jobs !
I have got a image that only contains one head, then I call face_recognition.face_encodings function so that I can get facial features for classfication. But it works too slow to complete to get facial features real-time.
I am trying to change my computer system such as ubantu.
I have added the small_face to my code ,but it did not work very well ,my code just as following:
face = obama_image_cv2[face_list[0][1]:(face_list[0][1]+face_list[0][3]), face_list[0][0]:(face_list[0][0]+face_list[0][2])]
small_frame = cv2.resize(face, (0, 0), fx=0.25, fy=0.25)
t1=time.clock()
obama_face_encoding = face_recognition.face_encodings(small_frame)[0]
print (time.clock()-t1)
obama_image is 300*300 and have 3 channels. It takes 0.45s to obtain the facial features from the small_frame.
My computer CPU cores is Inter Core i5 4460, 3.2GHz.
Thank you for help !
I wonder how fast the face_recognition_model in your system? Can u share the model consuming time in your system? Thank you for sharing !
I added a benchmark script to measure speed between different systems more easily: https://github.com/ageitgey/face_recognition/blob/master/examples/benchmark.py
@ageitgey Thank you for your reply! I made a mistake that the face_recognition_model was tested by cpu core, and the model run really fast in ubantu by GPU. Is it possible that the dlib run by GPU in Windows such as Win10 ? I have compiled CUDA by VS2015 in my computer, however i do not know how to make the dilb run on GPU. I searched on the internet to try find the something, such as dlib-gpu and so on, using google, and got anything useless.
I don't use Windows much myself, so I don't know much about how to set up dlib on Windows with CUDA.
In theory, dlib does support CUDA on Windows with the latest VS2015 update if you compile it correctly. Look at the newest comments on this thread: https://github.com/davisking/dlib/issues/243
But I get the impression that most people use Linux right now so there aren't many docs on using it on Windows. Sorry I can't help more.
@ageitgey Thank you all the same !
Sure thing. If you do find a good solution for compiling on Windows w/ CUDA and write it up, please let us know so we can link to it :)
@ageitgey Yes, of course, if i find one good solution, I would summbit it as soon as possible.
If you are using a library of known pictures that stay constant (or at least do not significantly change), then you can save the face encodings as numpy binary files and then read off of them later instead of calculating all of the face encodings again.
I did it here.
+1
I have the same problem here.
I have two machines with similar configurations I7, 16GB RAM, Nvidia.
One running linux (106 fps on face encondings) Another running windows 10 (1.78 fps)
Its so much different in performance.
I have already downloaded dlib, compiled it with CUDA and installed it on python.
Running this script:
import dlib.cuda as cuda
print(cuda.get_num_devices())
returns me 1 device.
I don't know what to try anymore, I think I will try processing this inside a linux container over windows 10 to check the performance.
Adding some information that I found now:
import dlib
dlib.DLIB_USE_CUDA
remains false.
I will try again recompiling and checking why not True.
But is it normal to take so much more time because not using CUDA?
Most helpful comment
I added a benchmark script to measure speed between different systems more easily: https://github.com/ageitgey/face_recognition/blob/master/examples/benchmark.py