Face Detection/Recognition In Python that gets 5FPS or more?

I know this is a bit of a general question, but I’m looking for some advice. I’m looking to do facial detection/recognition on a Jetson Nano (running Python3.6, JetPack 4.6, and OpenCV with CUDA acceleration enabled), and so far all of the examples and libraries I’ve seen take an unusually long time to do the processing.

For example, the Face_Recognition library (which uses dlib) seems to be unable to process images and return results in less than 500-800ms per image. I had an issue open on dlib’s github page (linked here), and we weren’t really able to reach a resolution. The closest we got was being able to get the performance I was after, but the accuracy had been affected so badly that it wasn’t really detecting faces anymore. A face detector/recognizer that doesn’t detect or recognize faces isn’t very useful, unfortunately.

I recently found and built the TrtMtcnn library (from here, which uses cython) and that can detect faces and landmarks in 70-100ms (depending on system load), which is fine, but that doesn’t do recognition, and the only recognition library I’ve been able to get working is Face_Recognition/dlib and, as I already mentioned, that gets HORRIBLE performance on the Jetson Nano.

I’m looking for some guidance/advice on face detector/recognition systems with a python interface (Python3.6 compatible) that will run on a Jetson Nano 4GB and get 5FPS or better performance.

It’s worth noting that I’ve also done similar work on a Raspberry Pi with the Intel Neural Compute Stick2 and the OpenVINO framework. There is a chain of 3 models in use there (that are in the IR optimized format for OpenVINO FP16) that is able to detect faces, detect landmarks, and do recognition in under 80ms or so on average, and the Jetson is a much more capable platform then the NCS2, so I am (possibly wrongly) assuming I’ll be able to get at least comparable performance. If i’m wrong, feel free to bonk me on the head and let me know I’m being dumb. :)

Any help is greatly appreciated!
Thanks in advance


Have you maximized the device performance first?

$ sudo nvpmodel -m 0
$ sudo jetson_clocks



Sorry for the slow reply. It’s a crazy week here, but I’m finally back at this! I haven’t. What exactly does this do? I guess I have some reading ahead of me!


I think it was already in the right mode. Output of “sudo nvpmodel -q” shows:

NVPM WARN: fan mode is not set!
NV Power Mode: MAXN

Do I understand that correctly?


Have you tried the jetson_clocks script?
It can lock the processor clock to maximal which will reduce the overhead of dynamic frequency.


Yes, but I haven’t seen any difference.


Please try to monitor the device status with jetson_clocks.
If the GPU utilization already reaches 99%, you should reach the device maximal.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.