dlib_encoder enhancement
Thanks for your helpful repository. I have tried dlib face encoder for face recognition purpose in coral developer board which takes around 800 ms for me.
Is it normal or am i missing something ?
Can i make this even faster ?
Did you compile dlib like this to use NEON per the readme:
# -O3 enables auto vectorization optimizations
# so that the compiler automatically uses NEON instructions.
$ python3 setup.py install --set DLIB_NO_GUI_SUPPORT=YES \
--set DLIB_USE_CUDA=NO --compiler-flags "-O3"
Generally dlib is the slowest of the three methods I tried for face detection on the coral dev board. For sure using the TPU is the fastest and is pretty accurate. If you need real-time operation I recommend using the TPU. See how to perform face detection using dlib, OpenCV and the TPU here.
Let me know if I can help further.
@goruck Yes. Installed dlib as mentioned. Initially i have used dlib for face detection, It took too much time ~ 1.16 s. So i have moved to ssd_mobilenet_v2_face_quant_postprocess_edgetpu.
Now i am looking to reduce (may be i can't) the Dlib face embed extraction time which is approx 0.8 s.
Is there any way to make dlib faster in coral dev board ? or Can i convert it as tflite model to use TPU ?
Note : I have tried dlib-to-tf-keras-converter which can't help me. Also having accuracy issue even while loaded with tensorflow.
@Bhanuchander210 in this project I use dlib via face_recognition.face_encoding to extract facial embeddings. These are then used to train a SVM to do real-time face recognition on faces found by inference on the TPU.
I extract and train off-line so real-time operation isn't a requirement for that. And the facial embeddings done by facial_recognition.face_encoding after the TPU finds faces are fast enough for my application.
So net is I have not looked at optimizing dlib on this platform.
What is your specific application that calls for fast extraction of facial embeddings?
Note: A possible alternative is to use OpenCV to extract the embeddings. I have a skeleton of this in the code (see this) but have not spend much time on it.
@goruck Dlib works faster in x86 as it takes approx 50 ms only, but in coral board it takes approx 800 ms which is not expected.
I am just trying / searching to optimise dlib for good fps as much as possible, even i am aware of that coral dev board is particular for TPU models :)