face_recognition
face_recognition copied to clipboard
Face recognition first call very slow on Jetpack 4.6
Hi - I am trying to use my Nano as much as OOB as possible Its just been re-created using jetpack 4.6
I have been adapting one of the JetsonHacks ideas to my own code involving facial recognition from video with Face_recognition. I applied the one line code fix to dlib as outlined in https://forums.developer.nvidia.com/t/issues-with-dlib-library/72600/16 https://medium.com/@ageitgey/build-a-hardware-based-face-recognition-system-for-150-with-the-nvidia-jetson-nano-and-python-a25cb8c891fd these relate to dlib 19.16 and 19.17 but it seems to still apply to 19.22 That got face_recognition to use the GPU when model="cnn" was used
However I am finding the startup time to be horrible the first call to face_recognition.face_locations(imageRGB ,model="cnn" ) takes 22 to 25 seconds. subsequent calls take about 0.3 sec to 0.9 sec for larger images for the 1st call it doesn't matter what size the image is
If the model is changed to model="hog" then the first call to face_recognition.face_locations, and each subsequent takes about 0.6 sec
Similar results for the calls to face_recognition.face_encodings Model='cnn' initial 2.69 sec then .04sec again size doesn't seem to affect it too much Model='hog' initial from 5.5 to 10 sec then .04sec
Over 20 seconds just feels like a timeout issue, probably between face_recognition and dlib, but that just me using 'the force'
Does anybody have any ideas how to make all these bits play nicely together?
Python 3.6.9
dlib.DLIB_USE_CUDA = True
dlib version = 19.22.0
dlib compiled = Nov 14 2021 16:36:45
face_recognition.__version__ = 1.2.3
cv2.__version__ = 4.1.1
camera = Raspberry V2
cuDNN = 8.2.1
Thanks JC