Is deep learning (i.e. face detection&recognition) in dlib thread safe? (with CUDA & without CUDA)
1.1. If no, is it possible to make it thread safe easily?
Is dnn face detection more accurate than standart HOG face detector?
Would please give an estimate time duration of a single face/image with dnn face detection and recognition (with NVidia 1080 Ti & enabled CUDA) ?
Best Regards.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear Davis.
1.1. If no, is it possible to make it thread safe easily?
Best Regards.
The normal thread safety rules apply here as they do to any other object.
See: http://dlib.net/intro.html
DNNs are more accurate than HOG but slower to execute. The specific timing
will depend on the sizes of your images. Run the examples and see.
I try to make myself clear.
Suppose, I want to initialize DNN's globally, something like that;
shape_predictor sp; deserialize("shape_predictor_5_face_landmarks.dat") >> sp;
anet_type net; deserialize("dlib_face_recognition_resnet_model_v1.dat") >> net;
then each thread calls the following function by itself (without re-initialization) ;
sp(img, face);
net(faces);
Does is make problem? Can threads successfuly exetuce its own sp & net DNNs.
I understand that global initialization makes problem, am I right?
That question is answered in the documentation I sent you. It's all
discussed in detail.