Headpose Speed can be increased - Improvement
naushadck opened this issue · comments
I checked the headpose.py. It uses caffe model. It is very slow on i5 with 16 GB RAM.
It can be faster, if use the dnn from tensorflow provided by opencv(\samples\dnn\face_detector\opencv_face_detector.pbtxt).
Added the following lines in init in class FaceDetector:.
dnn_proto_text='models/opencv_face_detector.pbtxt'
dnn_model='models/opencv_face_detector_uint8.pb'
self.face_net = cv2.dnn.readNetFromTensorflow(dnn_model, dnn_proto_text)
I hope this may helpful for someone....
So this looks like a quantized version of the one used. An additional boolean argument of quantized can be added in the get_face_model() of face_detector.py so the user whether they want to use the original or this based on their requirements trade-off for speed and accuracy.
If you want to add this feature you can start a pull request, or otherwise, I will add it.
An additional boolean argument of quantized can be added - Good
If you want to add this feature you can start a pull request, or otherwise, I will add it. -- I am not sure about it. Please carry on...
The face_detector.py has been updated with an additional quantized argument.