Comments (11)
@Cospel I submitted a dlib python wrapper for the mmod cnn face detector. So I should be able to make that an option in face_recognition when the next dlib update is released.
from face_recognition.
-
Great question. I looked into it. The problem is that dlib's CNN interface isn't available from python and I don't think @davisking has any plans to support that interface from Python (because of how it's written). So I don't think it's (easily) possible.
-
I think it will use a gpu if you compile dlib with CUDA support, but I can't remember for sure. I'll try recompiling it on my linux machine when I have a minute and check.
from face_recognition.
Yeah, it seems to use the GPU when you compile dlib
with CUDA support. Here's what the card reports when running face_recognition.face_encodings()
in a loop (passing in face locations so it doesn't have to re-look that up each time):
$ nvidia-smi
Fri Mar 17 16:51:41 2017
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 367.57 Driver Version: 367.57 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 980 Ti Off | 0000:01:00.0 On | N/A |
| 0% 47C P2 78W / 250W | 842MiB / 6074MiB | 39% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1251 G /usr/lib/xorg/Xorg 197MiB |
| 0 6181 C python3 283MiB |
With GPU support, it took me a little under a minute to calculate 10,000 face encodings. For comparison, my laptop (different hardware) without a GPU took over 4 min to do the same thing.
from face_recognition.
It's certainly possible to make a python API for the CNN face detector model. Although as @ageitgey mentioned, it's impossible to make a full wrapper for the entire DNN API in python because python lacks the core language mechanics to deal with the C++ API. But that's not what you are asking about.
As for GPU use. If you compile dlib to use CUDA it will use CUDA, if you don't then it won't. This has nothing to do with using python or anything else.
from face_recognition.
Also, I'm in general not very motivated to add dlib python wrappers since I hardly ever use pyhton myself. So someone else should do it and submit a PR :)
from face_recognition.
Fair enough @davisking. Thanks for the reply!
from face_recognition.
Thank you for your answers!
What I have now is face detection based on facenet/openface https://github.com/davidsandberg/facenet. And face recognition or better say face descriptor from dlib/resnet/face_recognition.
My expertise in C++ is very bad and it is few years that I last touch it. However I tried to play with C++ Boost to port MMOD CNN to the python but with no success.
from face_recognition.
@ageitgey How can i compile the dlib with CUDA support ? Usually I use 'python setup.py install' to install the dlib in Ubantu. How can I make sure the dlib with CUDA support is successful ?
from face_recognition.
from face_recognition.
@davisking Yes, thank you !
from face_recognition.
@davisking Hi. I already compiled dlib with cuda enable.
In c++ code,dlib::cuda::get_num_devices()==1,but dlib::cuda::get_device_name=="CUDA_DISABLED".And MMOD face detector use the cpu version instead of cuda.Do you have any idea?
from face_recognition.
Related Issues (20)
- Not accurate HOT 1
- Problem "ValueError: operands could not be broadcast together with shapes ( , ) (128, )" Solution
- fcaial recognition wrong person
- I want to detect whether the faces in the pictures are complete HOT 1
- Face similiarity for multiple images
- Fr
- test HOT 1
- Windows installation HOT 5
- Windows face_recognition run time error HOT 1
- Facial
- Shared My Dockerfile
- Face recognition in the Voynich manuscript
- face_recognition only works with obama. HOT 3
- kindly integrate face alignment step
- Import gets stuck while using it inside a myfunctions module
- Attribute error HOT 1
- dlib HOT 2
- image de-duplication by comparing faces images.
- Will your face_recognition application allow me to store pictures with names tide to them and just later down the line submit a new photo of someone who i dont remember i actually stored, and then the application when i send the photo identifies the person in the photo because its the exact person i stored of their name in a different photo i have saved?
- Face recorgon
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from face_recognition.